开发者

wx.combobox managed by sizer?

开发者 https://www.devze.com 2023-03-14 09:45 出处:网络
I\'ve been looking around the web and all the examples I\'ve seen have a given pos=(x,y) attribute for a wx.ComboBox or wx.Choice. However I need to let the position of the combobox (or an equivalent

I've been looking around the web and all the examples I've seen have a given pos=(x,y) attribute for a wx.ComboBox or wx.Choice. However I need to let the position of the combobox (or an equivalent Widget) be managed by my sizer. Doing:

    itemSelect = wx.ComboBox(self, choices = list, style = wx.CB_DROPDOWN)      
    itemSelect.AppendItems(strings=list)
    itemSelect.Select(n=0)
    itemSizer.Add(itemSelec开发者_StackOverflow中文版t, 1, wx.EXPAND)

This creates the combobox but it is displayed in wrong positions. Should this work or is it another way to add it to the sizer ?

Regards, Bogdan


Your code should work, assuming there is more code you aren't showing us. Are you calling self.SetSizer(itemSizer) to associate the sizer with you container widget?

0

精彩评论

暂无评论...
验证码 换一张
取 消