In MAXGui: I know that GadgetLostFocus notifies the leaving of a gadget, but how do I know that the cursor is on a specific textfield, if no changes have been made to the text?
How can I identify a textfield just selected?
BlitzMax Forums/BlitzMax GUI Programming/How can I identify a textfield just selected? Function ActiveGadget:TGadget()
Returns The gadget if any that currently has the keyboard focus.
Description Return the currently active Gadget.
Returns The gadget if any that currently has the keyboard focus.
Description Return the currently active Gadget.
Ahhh - wouldn't do that if I were you. Your program's CPU usage will max out your processor. I'd use a timer if I was that stuck but even then, it's hardly ideal...
Cardinal rule of application programming: don't check if nothing has changed = don't do something unless an event has happened = always use WaitEvent(). ;-) True, there aren't events (at the moment) which show you this particular thing has changed but even using a timer to check every 100 milliseconds would be better than your current loop which is just wasting billions of CPU cycles.
There may be a few tricks up my sleeve with the current development version of MaxGUI I'm testing - I'll let you know more once it's available on SVN, but it should help you out somewhat...
Btw, when posting code, use the [code ] or [codebox ] tags - see the following page for more info: What are the forum codes?. I've edited your original post to show you how its done... ;-)
Cardinal rule of application programming: don't check if nothing has changed = don't do something unless an event has happened = always use WaitEvent(). ;-) True, there aren't events (at the moment) which show you this particular thing has changed but even using a timer to check every 100 milliseconds would be better than your current loop which is just wasting billions of CPU cycles.
There may be a few tricks up my sleeve with the current development version of MaxGUI I'm testing - I'll let you know more once it's available on SVN, but it should help you out somewhat...
Btw, when posting code, use the [code ] or [codebox ] tags - see the following page for more info: What are the forum codes?. I've edited your original post to show you how its done... ;-)
I knew it was an "ugly" workaround, but I needed something, so I could test the rest of my code.
From your post I take it there is no "clean" solution at the moment. (Until You shake those sleeves) ;)
In the meantime I will have to make sure there is always a gadget selected, so I can keep track of the cursor.
Let's see how this evolves...
From your post I take it there is no "clean" solution at the moment. (Until You shake those sleeves) ;)
In the meantime I will have to make sure there is always a gadget selected, so I can keep track of the cursor.
Let's see how this evolves...