Weird ComboBox behavior

I've inserted a combo on my frame, and strangely when you open it, it only
displays one line, and that makes you scroll line per line until you find
your choice. Besides, it looks very ugly. :frowning:

This is the constructor I've used:
wxComboBox( self, -1, (""), wxDefaultPosition, wxSize(125,21),
comboBox1Strings, wxCB_READONLY )

I'm using Python 2.3, wxPython 2.4.2 and Win98
Anyone has an idea?

Se帽or Cuervo wrote:

I've inserted a combo on my frame, and strangely when you open it, it only
displays one line, and that makes you scroll line per line until you find
your choice. Besides, it looks very ugly. :frowning:

This is the constructor I've used:
wxComboBox( self, -1, (""), wxDefaultPosition, wxSize(125,21),
comboBox1Strings, wxCB_READONLY )

This is a known problem (which may have been fixed in 2.5, I don't recall right now) but the workaround is easy. The dropdown is affected by the size you pass in to the constructor, but if you give it a default value it should do the right thing. Try this:

  wxComboBox( self, -1, (""), wxDefaultPosition, wxSize(125,-1),
    comboBox1Strings, wxCB_READONLY )

路路路

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

If I remember correctly, it could have to do with the number of elements in
the list (comboBox1Strings) when the control is created. Do you have all
your strings in that list, or are you trying to add them later? I seem to
recall creating a list of 10 empty strings for initializing a ComboBox that
I needed to fill after it was created.

Hope that helps.

David

路路路

-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of Se帽or Cuervo
Sent: Tuesday, May 11, 2004 12:36 PM
To: wxpython-users@lists.wxwindows.org
Subject: [wxPython-users] Weird ComboBox behavior

I've inserted a combo on my frame, and strangely when you open it, it only
displays one line, and that makes you scroll line per line until you find
your choice. Besides, it looks very ugly. :frowning:

This is the constructor I've used:
wxComboBox( self, -1, (""), wxDefaultPosition, wxSize(125,21),
comboBox1Strings, wxCB_READONLY )

I'm using Python 2.3, wxPython 2.4.2 and Win98
Anyone has an idea?

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Unfortunatelly that didn't work. I had tried it before.
The workaround proposed by David did.
Thank you for helping

"Robin Dunn" <robin@alldunn.com> wrote in message
news:40A11DC4.6040209@alldunn.com...
Se锟給r Cuervo wrote:

I've inserted a combo on my frame, and strangely when you open it, it only
displays one line, and that makes you scroll line per line until you find
your choice. Besides, it looks very ugly. :frowning:

This is the constructor I've used:
wxComboBox( self, -1, (""), wxDefaultPosition, wxSize(125,21),
comboBox1Strings, wxCB_READONLY )

This is a known problem (which may have been fixed in 2.5, I don't
recall right now) but the workaround is easy. The dropdown is affected
by the size you pass in to the constructor, but if you give it a default
value it should do the right thing. Try this:

wxComboBox( self, -1, (""), wxDefaultPosition, wxSize(125,-1),
comboBox1Strings, wxCB_READONLY )

路路路

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