ComboBox problems (bug?)

I have this simple example.

Then I try to change the selected value into my combo, on win it "print"
the right value, on linux, it print the preceding value. It's a bug?

And after, on win then this frame is load, there is no values into the
combo, on linux, there is the first load. I think that is better if
there is no values loaded the the frame appear

Thanks,
Michele Petrazzo

import wx

class FramePrev(wx.Frame):
     def __init__(self, parent):
         wx.Frame.__init__(self, parent)
         self.c1 = wx.ComboBox(self, pos=wx.Point(10,10))
         self.c1.Bind(wx.EVT_COMBOBOX, self.oncombo1)
         self.c1.Append('test1')
         self.c1.Append('test2')
         self.c1.Append('test3')

     def oncombo1(self, event):
         print self.c1.GetValue()

class MyApp(wx.App):
     def OnInit(self):
         self.main = FramePrev(None)
         self.main.Show()
         return True

if __name__ == '__main__':
     app = MyApp(0)
     app.MainLoop()

Michele Petrazzo wrote:

Then I try to change the selected value into my combo, on win it "print"
the right value, on linux, it print the preceding value. It's a bug?

Oopss, "When", not "Then"

Sorry for English,
Michele

Michele Petrazzo wrote:

I have this simple example.

Then I try to change the selected value into my combo, on win it "print"
the right value, on linux, it print the preceding value. It's a bug?

Which version? I don't see this with the current release, gtk2-unicode build. You could also try to get the new value from the event.GetString() instead.

And after, on win then this frame is load, there is no values into the
combo, on linux, there is the first load. I think that is better if
there is no values loaded the the frame appear

That is just the different ways that the native widgets work. You can make the first value in your list be an empty string and it will work everywhere.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Michele Petrazzo wrote:

I have this simple example.

Then I try to change the selected value into my combo, on win it "print"
the right value, on linux, it print the preceding value. It's a bug?

Which version? I don't see this with the current release, gtk2-unicode build.

[michele@michele michele]$ python
Python 2.3.3 (#2, Feb 17 2004, 11:45:40)
[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import wx
wx.__version__

'2.5.3.1'

my specific version is:
wx-2.5.3-gtk2-unicode

You could also try to get the new value from the

event.GetString() instead.

I forgot to use this. Thanks

And after, on win then this frame is load, there is no values into the
combo, on linux, there is the first load. I think that is better if
there is no values loaded the the frame appear

That is just the different ways that the native widgets work. You can make the first value in your list be an empty string and it will work everywhere.

Yes, but after this I see a blank space when I open my combo, and I
don't like this. I'll leave all like now.

Thanks,
Michele