Hello again!
Sorry, but i ask a second time. Till this day, i got no solution for a
problem i posted ti mailing list.
Look at http://aspn.activestate.com/ASPN/Mail/Message/wxpython-users/3353114
So does anybody has a good advice, what i can do, to set the value of a
wx.ComboBox-Control during runtime and without insert the new value into the
list "choices" if the control?
Thanks and regards
Jamil
···
-----Ursprüngliche Nachricht-----
Von: J. Raichouni [mailto:j.raichouni@sector.de]
Gesendet: Freitag, 1. Dezember 2006 21:37
An: 'wxpython-users@lists.wxwidgets.org'
Betreff: wx.ComboBox
Hello!
This is my first email to you, i hope it will reach you.
Sorry for my bad english, i'm german.
I've a problem with wx.ComboBox (See example below).
There are to ComboBoxes (both with initial parameter choices =
['Mustermann', 'Musterfrau'] Why is'nt it possible to set initial paramter
value = 'Muster' but i can set value = 'Test'?
Same problem exists by setting the value during runtime with the method
SetValue('Muster')
Regard and looking forward to a solution Jamil
-------------------------------------
# -*- coding: iso-8859-1 -*-
# File: test.py
import wx
#------------------------------------------------------------------------
class MyFrame(wx.Dialog):
def __init__(self, parent, title):
wx.Dialog.__init__(self, parent, -1, title,
pos=(150, 150), size=(300, 350))
panel = wx.Panel(self, -1)
obj1 = wx.ComboBox(parent=panel, size=(200, wx.DefaultSize.height),
choices=['Mustermann', 'Musterfrau'],
value='Test',
style=wx.CB_DROPDOWN)
obj2 = wx.ComboBox(parent=panel, size=(200, wx.DefaultSize.height),
choices=['Mustermann', 'Musterfrau'],
value='Muster',
style=wx.CB_DROPDOWN)
main_sizer = wx.BoxSizer(wx.VERTICAL)
main_sizer.Add(obj1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 15)
main_sizer.Add(obj2, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 15)
panel.SetSizer(main_sizer)
main_sizer.Fit(self)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
class MyApp(wx.App):
def OnInit(self):
dialog = MyFrame(None, 'Titel')
if dialog.ShowModal() == wx.ID_OK:
print dialog.object.GetDate()
return True
app = MyApp(0)
app.MainLoop()