I am new to Boa, and cannot figure out how to have the inspector generate an event handler for a text event for a spinctrl, i.e., my spinctrl works correctly for spin up and spin down, but when I type a new number into the control, no handler is called. I have found a workaround, i.e., I have manually inserted the EVT_TEXT call into the code myself, but assume the inspector should allow me to specify that I want this code to be generated. How do I do this?
(I work under windows xp)
Always forget to mention, hopefully Riaan will read this and fix it in the next release.
In the Boa Editor, select the control, then go to the inspector and click on the "Evts" tab, then click in the empty space on the left side on "line 1 - n" and the different events available will show up. Select the appropriate one on the right hand side and it will generate the code stubs.
Hi Werner, thanks for the reply. However, that is exactly what I do (for example, by selecting the spinctrlevent and associating a handler with EVT_SPINCTRL), but the EVT_TEXT event is not in the list of all events for a wxSpinCtrl that boa shows. However, wxPython clearly knows this event, because when I manually add a handler (by calling EVT_TEXT()), it works.
So, then, what to do?
Searching around in Boa, I found that adding "
, 'TextCtrlEvent'" to line 230 in ButtonCompanions.py which is in boa/companions and restarting Boa will give you the textctrl events for wxSpinCtrl.
Now I am not experienced enough to know if this is the right thing to do, hopefully Riaan or someone else can confirm that this is ok.
you are right, that does it! Thanks a lot.
Log in to post a comment.