473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1059

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: achrist | last post by:
I've just installed the new wxPython, version 2.4.2.4 (under Windows NT, sp6, python 2.3.2) and tried to create an exe using the McMillan installer. Seems to be a new problem ... I've got the...
0
by: John Perks and Sarah Mount | last post by:
(Having problems receiving wxPython mailing list entries, so I'll ask here.) I'm using wxPython 2.5.4, windows ansi version, on Python 2.4, the OS in Win98SE. My application manipulates a graph,...
1
by: Adam Endicott | last post by:
I'm having some trouble using an HtmlListBox with a GridBagSizer. I'm not sure how best to explain what's happening, but it seems that every time my frame gets resized, the HtmlListBox grows...
4
by: KvS | last post by:
Hi all, I'm pretty new to (wx)Python so plz. don't shoot me if I've missed something obvious ;). I have a panel inside a frame, on which a Button and a StaticText is placed: self.panel =...
1
by: bcwhite | last post by:
Python v2.5 wxPython v2.8.3.0 I've got an app that has a wx.Panel managed by a FlexGridSizer. There are 5 columns and 6 rows, all with StaticText widgets and all of similar size. Everything...
1
by: justme | last post by:
Hello I've been happily scripting away for the last few years (Matlab, now Python) and all has been fine. Now I find myself scripting up code for clients, but they all want a nice GUI. I've had...
5
by: Benjamin | last post by:
I'm writing a search engine in Python with wxPython as the GUI. I have the actual searching preformed on a different thread from Gui thread. It sends it's results through a Queue to the results...
1
by: Massi | last post by:
Hi everyone! In my application (under windows) I'm using a wx.checklistbox. I would like the background color of an item to become red whenever an EVT_LISTBOX_DCLICK occurs. Is there any simple...
16
by: Andrea Gavana | last post by:
Hi Diez & All, Do you mind explaining "why" you find it *buttugly*? I am asking just out of curiosity, obviously. I am so biased towards wxPython that I won't make any comment on this thread...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.