DTextEntry - Cursor not showing

I’ve had this problem with my chatbox since a while now; the text entry doesn’t show the cursor, even without overriding the Paint hook:


local entry = vgui.Create(“DTextEntry”, self)
entry.Paint = function(me)
draw.RoundedBox(0, 0, 0, me:GetWide(), me:GetTall(), Color(0, 0, 0, 200))
draw.SimpleText(me:GetValue(), “DermaDefault”, 3, me:GetTall() * 0.5, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
surface.SetDrawColor(125, 125, 125, 150)
surface.DrawOutlinedRect(0, 0, me:GetWide(), me:GetTall())

me:DrawTextEntryText(color_white, me.m_colHighlight, color_white)

self.TextEntry = entry

What could possibly go wrong?

Use textEntry:DrawTextEntryText(text color, highLightColor, cursor color)

[editline]7th May 2013[/editline]

Oh you already did that. Was it showing before you changed the paint function?

Don’t you need to set the cursor? From what I can see you just have the color of it, not what cursor to use.

[editline]8th May 2013[/editline]

This might help, the default chat box cursor is in the code: https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/vgui/dtextentry.lua

Nope, still nothing.

Can you please post what you have right now?

[editline]8th May 2013[/editline]

Actually, don’t worry about posting what you have now. I’ve looked into it a bit for you and I believe that you’ll need to add a few lines to your code to get a working cursor. Unfortunately I don’t know know much about cursor coding but I recommend you speak to someone else or research and look into other codes/scrips/help-pages for further assistance. I wish I could help you more but I can’t at this point of time, sorry.

If it’s your chatbox then it’s because it has no focus probably, the focus is probably on the old chatbox. Are you using ChatTextUpdated or w/e that hook is called?

Yeah, for now I’ve made it so the TextEntry requests the focus (don’t even know if it actually has it), I’ll try with the chatbox panel itself.

**Edit: **Even after requesting focus (StartChat), the chatbox doesn’t seem to have it.

You should return true/false (forgot which, try both :v:) and then request focus next tick to make your textentry be the one with focus IIRC

Did you solve it? How?