I have a wxTextCtrl and I would like to save it's
content when the user has finished to input data. For
this purpose I'm using the EVT_KILL_FOCUS.
But I've the following behaviour :
- the EVT_KILL_FOCUS is not triggered when you click
on buttons defined into the Toolbar
- but, the EVT_KILL_FOCUS is triggered when you click
on "normal" button or wxTextCtrl or wxComboBox
- I've defined an EVT_CLOSE for my main window, and if
you close the window by clicking on the usual small
cross (at upper right corner), the EVT_KILL_FOCUS is
triggered after the self.Destroy() ... So, getting the
content of the wxTextCtrl generate a "memory fault".
I tought that the EVT_KILL_FOCUS should be triggered
each time the user click outside my wxTextCtrl.
- I've defined an EVT_CLOSE for my main window, and if
you close the window by clicking on the usual small
cross (at upper right corner), the EVT_KILL_FOCUS is
triggered after the self.Destroy() ... So, getting the
content of the wxTextCtrl generate a "memory fault".
I have a wxTextCtrl and I would like to save it's
content when the user has finished to input data. For
this purpose I'm using the EVT_KILL_FOCUS.
But I've the following behaviour :
- the EVT_KILL_FOCUS is not triggered when you click
on buttons defined into the Toolbar
- but, the EVT_KILL_FOCUS is triggered when you click
on "normal" button or wxTextCtrl or wxComboBox
If you just want to avoid losing the latest changes the user makes to the data in the text control, you could use EVT_TEXT(self.txt, handler_function) to save the value whenever it is modified.
But this is not working well (with wxGTK) when some
words are HighLighted (I change the Font color to
WHITE and Bakground color to BLUE).
(My wxTextCtrl is with the style wxTE_RICH.)
It has been recognized as a "bug".
--- "David C. Fox" <davidcfox@mediaone.net> wrote:
vincent delft wrote:
> I have a wxTextCtrl and I would like to save it's
> content when the user has finished to input data.
For
> this purpose I'm using the EVT_KILL_FOCUS.
>
> But I've the following behaviour :
>
> - the EVT_KILL_FOCUS is not triggered when you
click
> on buttons defined into the Toolbar
> - but, the EVT_KILL_FOCUS is triggered when you
click
> on "normal" button or wxTextCtrl or wxComboBox
If you just want to avoid losing the latest changes
the user makes to
the data in the text control, you could use
EVT_TEXT(self.txt,
handler_function) to save the value whenever it is
modified.
David
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org