I keep getting fooled into thinking that I can type in my client window when it isn't selected.
This is because the caret is flashing even though the window does not have focus.
The EditBox should still use its focused images, but I just wish that the selection point would stop flashing.

Re: Stop selection point from flashing when window does not have focus
« Reply #1 on: 21 September 2013, 22:31:13 »
To implement this, TGUI would need to keep track of whether the SFML window has focus using its events
When the SFML window does not have focus, the selection point would not be drawn ever

Edit:
It might also be worth exposing the function with tgui::Gui::hasFocus
« Last Edit: 21 September 2013, 22:34:16 by wizzard »

*

texus

  • *****
  • 1172
    • View Profile
    • Texus's Blog
Re: Stop selection point from flashing when window does not have focus
« Reply #2 on: 21 September 2013, 22:37:52 »
This is actually your responsibility. Your program is still running in the background.

When the window loses focus you should ignore all events (and don't call gui.handleEvent) until the window gets focused again.

Re: Stop selection point from flashing when window does not have focus
« Reply #3 on: 21 September 2013, 22:48:34 »
The flashing of the selection point happens via mainWindowGui.draw() though

Edit: By the way, I tried it just in case it oddly worked
« Last Edit: 21 September 2013, 22:54:34 by wizzard »

Re: Stop selection point from flashing when window does not have focus
« Reply #4 on: 21 September 2013, 22:51:55 »
I guess the first post is a bit confusing...

When the SFML render window does not have focus, the TGUI edit box has a flashing caret.
I just want it stop flashing when the SFML render window is not focused.
The point I was trying to make up above is that the TGUI edit box should still be focused regardless.
However, the little flashing caret should stop flashing when you can't type into the box.
If the SFML render window does have focus again, I would be able to type into the box.
So, the flashing caret would depend on whether or not the SFML render window has focus.

*

texus

  • *****
  • 1172
    • View Profile
    • Texus's Blog
Re: Stop selection point from flashing when window does not have focus
« Reply #5 on: 22 September 2013, 00:09:18 »
I didn't have much time earlier, so just ignore my previous answer.

I'm now blocking the update function when the window isn't focused, so any animation (at this point only the flashing caret) will be paused as long as the window is unfocused.

There is only one small thing, I don't know if the window is going to be focused when the program starts. This is something that might be OS-dependant (and I only tested on linux so far) so let me know when the caret doesn't flicker at all.

Re: Stop selection point from flashing when window does not have focus
« Reply #6 on: 22 September 2013, 00:38:17 »
Thanks for this change! I will notify you if there is some weird behavior on Windows.
(but I'm pretty sure the window is focused at first on all Windows platforms)