I have a problem with a text ctrl. I did bind the
text ctrl to EVT_KILL_FOCUS. When the event is triggered I update
the value.
The problem is if the user changes the text ctrl and does save from the menu without leavinge the
text ctrl. Then the EVT_KILL_FOCUS doesnt get triggered. So the old value will be saved.
Is there any event other event I can use that triggers when the user 'exits' a ctrl and which also
triggers on menu events.
I would prefer not to bind to evt_text and update the value for each char pressed.
I have a problem with a text ctrl. I did bind the
text ctrl to EVT_KILL_FOCUS. When the event is triggered I update
the value.
The problem is if the user changes the text ctrl and does save from the menu without leavinge the text ctrl. Then the EVT_KILL_FOCUS doesnt get triggered. So the old value will be saved.
Is there any event other event I can use that triggers when the user 'exits' a ctrl and which also
triggers on menu events.
You could have something that saves/validates the whole form before changing things from the menu handler.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I have a problem with a text ctrl. I did bind the
text ctrl to EVT_KILL_FOCUS. When the event is triggered I update
the value.
The problem is if the user changes the text ctrl and does save from the menu without leavinge the text ctrl. Then the EVT_KILL_FOCUS doesnt get triggered. So the old value will be saved.
Is there any event other event I can use that triggers when the user 'exits' a ctrl and which also
triggers on menu events.
I would prefer not to bind to evt_text and update the value for each char pressed.
This is a common problem in all development environments I've encountered so far. Make a method of the textbox called FlushValue() that you call from your onKillFocus() code. Make a method of your frame called ActiveControlFlushValue() that finds out what the active control is and calls its FlushValue() code. Call ActiveControlFlushValue in your menu save code as well as possibly from your form close code.
I don't know of an event that will do what you want.
I have a problem with a text ctrl. I did bind the
text ctrl to EVT_KILL_FOCUS. When the event is triggered I update
the value.
The problem is if the user changes the text ctrl and does save from the menu without leavinge the text ctrl. Then the EVT_KILL_FOCUS doesnt get triggered. So the old value will be saved.
Is there any event other event I can use that triggers when the user 'exits' a ctrl and which also
triggers on menu events.
I would prefer not to bind to evt_text and update the value for each char pressed.
This is a common problem in all development environments I've encountered so far. Make a method of the textbox called FlushValue() that you call from your onKillFocus() code. Make a method of your frame called ActiveControlFlushValue() that finds out what the active control is and calls its FlushValue() code. Call ActiveControlFlushValue in your menu save code as well as possibly from your form close code.
I don't know of an event that will do what you want.
I have a problem with a text ctrl. I did bind the
text ctrl to EVT_KILL_FOCUS. When the event is triggered I update
the value.
This is a common problem in all development environments I've encountered so far. Make a method of the textbox called FlushValue() that you call from your onKillFocus() code. Make a method of your frame called ActiveControlFlushValue() that finds out what the active control is and calls its FlushValue() code. Call ActiveControlFlushValue in your menu save code as well as possibly from your form close code.
I don't know of an event that will do what you want.