EditBox not editable

Started by RGPaul, 24 April 2023, 18:29:40

RGPaul

Hey,

I added an EditBox to a Panel. If I click it, it highlights and the cursor blinks, but I cannot enter any text.

Any idea what might be the problem?

texus

Are you passing the SDL_EVENT_TEXT_INPUT events to gui.handleEvent?

RGPaul

Okay, that must be it. Thanks  :D

RGPaul

Hmmm I use gui.mainLoop and checked that method.
Shouldn't that pass SDL_EVENT_TEXT_INPUT to gui.handleEvent?

RGPaul

Okay I read some more code of the container class. I have some custom Widgets between the root container and the editbox. So I probably have to passthrough enterText or something.

texus

If you are using gui.mainLoop then it should just work (as it calls gui.handleEvent for all SDL events).

For a custom widget you will need to override textEntered (and probably also keyPressed to handle backspace).

RGPaul