wx.Choice losing attributes when new items added

I’m working with wxPython on Linux (Ubuntu 11.10) and have a wx.Choice dropdown. When created I have some initial values with specific font and color choices. Later in the application I’m adding additional items to the choice widget (while the panel the widget is on it not being shown) but the new items are not respecting the font and colors even though they are being set. The initial items in the choice show as desired.

Is there an additional step required to change these fonts and colors?

Thanks!

Ron

Please make a runnable, small as possible, sample application that demonstrates the problem. MakingSampleApps - wxPyWiki

···

On 10/27/11 6:26 AM, Ron Kneusel wrote:

I'm working with wxPython on Linux (Ubuntu 11.10) and have a wx.Choice
dropdown. When created I have some initial values with specific font and
color choices. Later in the application I'm adding additional items to
the choice widget (while the panel the widget is on it not being shown)
but the new items are not respecting the font and colors even though
they are being set. The initial items in the choice show as desired.

Is there an additional step required to change these fonts and colors?

--
Robin Dunn
Software Craftsman

Robin-

In making my example I figured it out. I was creating all the panels and their widgets before calling Show(True) on the frame that contains them. When doing this, calling AppendItems() or SetItems() on a Choice caused the problem I described. However, if I call Show(True) on the frame first, the appending works properly.

Ron

···

Date: Thu, 27 Oct 2011 12:51:57 -0700
From: robin@alldunn.com
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] wx.Choice losing attributes when new items added

On 10/27/11 6:26 AM, Ron Kneusel wrote:

I’m working with wxPython on Linux (Ubuntu 11.10) and have a wx.Choice
dropdown. When created I have some initial values with specific font and
color choices. Later in the application I’m adding additional items to
the choice widget (while the panel the widget is on it not being shown)
but the new items are not respecting the font and colors even though
they are being set. The initial items in the choice show as desired.

Is there an additional step required to change these fonts and colors?

Please make a runnable, small as possible, sample application that
demonstrates the problem. MakingSampleApps - wxPyWiki


Robin Dunn
Software Craftsman
http://wxPython.org


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en