469,290 Members | 1,941 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

wxPython: changing entries of a HtmlListBox

KvS
Hi all,

a question wrt renewing the entries in a wx.HtmlListBox, I don't
understand how to do it.

I have some global variable containing a list:

gl_NAWList=["Bet","Dik"]

then I create a subclass of wx.HtmlListBox as described in the wxPython
demo:

class MyHtmlListBox(wx.HtmlListBox):
def OnGetItem(self, n):
return gl_NAWList[n]

and this works well after putting an instance called "hlb" of it in a
frame etc. Now I want to change the entries in hlb and I thought I
should simply be able to call the following function (bound to a button
click, "self" refers to the frame on which both teh button and hlb are
placed):

def klik(self, event):
gl_NAWList=["Boy","Boy"]
#print "gl_NAWList = ",gl_NAWList
self.hlb.SetItemCount(len(gl_NAWList))
self.Refresh()

but that doesn't seem to be working in the sense that the entries are
still "Bet" and "Dik". Also if I change this code to completely destroy
teh existing hlb and create a new instance it's not working. As will
probably be painfully clear ;) I just started playing a bit around with
wxPython. Any hints would be very much appreciated!

Thanks, Kees

May 25 '06 #1
0 967

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by achrist | last post: by
reply views Thread by John Perks and Sarah Mount | last post: by
1 post views Thread by Adam Endicott | last post: by
1 post views Thread by bcwhite | last post: by
1 post views Thread by justme | last post: by
5 posts views Thread by Benjamin | last post: by
16 posts views Thread by Andrea Gavana | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.