cioma
unread,Dec 14, 2009, 7:52:24 PM12/14/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wxPython-users
Greetings!
I'm using wxPython 2.8.10.1 on Win32 and have the following problem
when using SetValue() on wx.ComboBox (a test example):
I create a combobox:
choices = ['<Browse directory...>', '<Browse list file...>']
source_combobox = wx.ComboBox(parent=self, choices=choices)
source_combobox.Bind(event=wx.EVT_COMBOBOX,
handler=controller.on_evt_combobox)
source_combobox.Bind(event=wx.EVT_TEXT,
handler=controller.on_evt_combobox)
...and bind it to this handler:
class MyController:
def on_evt_combobox(self, event):
event.GetEventObject().SetValue('mytext')
event.GetEventObject().GetValue()
The idea is to change the value of the text field of combobox
depending on combobox item selection.
Now if I press a keyboard button wx.EVT_TEXT event is initiated and
value of the text field becomes 'mytext' (as expected). But if I
select i.e. '<Browse directory...>' from the combobox with a mouse
then textfield value stays as '<Browse directory...>'. But the strange
thing is that GetValue() returns 'mytext' (as expected)
I feel I'm doing something wrong here (refreshment problem?). Could
anyone please give me any ideas?