I'm only just starting with wxWidgets, and don't see any straight forward information on what event type I should use in a Bind statement.
For example, I wanted to do some processing when the text in a wxTextCtrl is changed by the user. I googled around and found out I want wxEVT_COMMAND_TEXT_UPDATED, but I can't see anywhere this is documented in a straight forward way. For instance searching the wxwidgets.org documentation for wxEVT_COMMAND_TEXT_UPDATED produces no results.
Am I misunderstanding something?
How do I know which event type to use?
-
- In need of some credit
- Posts: 8
- Joined: Tue Mar 30, 2021 11:31 pm
Re: How do I know which event type to use?
You know you are interested in an event generated by a wxTextCtrl, so you go to its docs:
https://docs.wxwidgets.org/trunk/classwx_text_ctrl.html
There is a section named "Events emitted by this class" and looking at the four events listed, it is pretty clear that wxEVT_TEXT is the one.
If you search wxWidgets include folder, you will find that wxEVT_COMMAND_TEXT_UPDATED is the old and no longer used alias for wxEVT_TEXT:
https://github.com/wxWidgets/wxWidgets/ ... trl.h#L923
BTW, when wanting to know how to use a wxWidgets class, it is often useful to look at the source of a bundled sample showing it off, here "text".
https://docs.wxwidgets.org/trunk/classwx_text_ctrl.html
There is a section named "Events emitted by this class" and looking at the four events listed, it is pretty clear that wxEVT_TEXT is the one.
If you search wxWidgets include folder, you will find that wxEVT_COMMAND_TEXT_UPDATED is the old and no longer used alias for wxEVT_TEXT:
https://github.com/wxWidgets/wxWidgets/ ... trl.h#L923
BTW, when wanting to know how to use a wxWidgets class, it is often useful to look at the source of a bundled sample showing it off, here "text".
Re: How do I know which event type to use?
Hi,
See this wxWiki page: it links to a page that you should find helpful. In particular you'll find wxEVT_COMMAND_TEXT_UPDATED in a list of aliases, preceded by the comment:
"These aliases are new in 3.0. Various event-types of the form 'wxEVT_COMMAND_*' are now 'wxEVT_*'. The old forms still exist and are likely to do so for a long time. However new code should use the new form."
If for some reason you're still using wx2.8, there's a link there for that too.
Regards,
David
See this wxWiki page: it links to a page that you should find helpful. In particular you'll find wxEVT_COMMAND_TEXT_UPDATED in a list of aliases, preceded by the comment:
"These aliases are new in 3.0. Various event-types of the form 'wxEVT_COMMAND_*' are now 'wxEVT_*'. The old forms still exist and are likely to do so for a long time. However new code should use the new form."
If for some reason you're still using wx2.8, there's a link there for that too.
Regards,
David