wxchoice appenitems not working

18 views
Skip to first unread message

Clay Richmond

unread,
Feb 27, 2015, 3:31:20 PM2/27/15
to wxpytho...@googlegroups.com
When I try to "append" the rows returned to the widget only places  one row , the last row ... when i try to "append items" to the widget only one row is shown but it is shown as a column ... what am I doing wrong ???


self.weather2 = wx.Choice(self.panel, wx.ID_ANY, choices = self.nameofevet1, name='ShowList') self.populateVenue(self) def populateVenue(self,event): conn = lite.connect("C:\Python26\sign1\VenueShow\PermPatRecord.sqlite") c = conn.cursor() c.execute('select * from showlist') rows=c.fetchall() rRows=[] for row in rows: s={} s['Venue_name'] =row[1] self.nameofevet1 = s['Venue_name'] print self.nameofevet1 self.weather2.Clear() self.weather2.AppendItems(self.nameofevet1)

Robin Dunn

unread,
Mar 6, 2015, 8:35:11 PM3/6/15
to wxpytho...@googlegroups.com
Clay Richmond wrote:
> When I try to "append" the rows returned to the widget only places one
> row , the last row ... when i try to "append items" to the widget only
> one row is shown but it is shown as a column ... what am I doing wrong ???
>
>

It looks like you are overwriting s['Venue_name'] with a single item
each time through the loop, instead of appending the items to a list.
So when you get to AppendItems you only have one.


--
Robin Dunn
Software Craftsman
http://wxPython.org
Reply all
Reply to author
Forward
0 new messages