473,715 Members | 5,945 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(w x.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_NAWLis t
self.hlb.SetIte mCount(len(gl_N AWList))
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 1081

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

Similar topics

0
1524
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 5b5 version of the McMillan installer. It crashes around line 161 of its mf.py module, where it is analyzing my program and pulling information out of the Windows registry. It looks in HKLM\Software\Python\PythonCore\2.3\Modules\wxPython
0
1367
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, with CircleShapes for nodes and LineShapes for arcs. The user needs to be able to get and set text on a arc. When I use LineShape.AddText(), a large rectangle of background colour blocks out much of the line, crucially including the arrow at the...
1
3493
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 taller, even when the resize is only horizontal, or makes the frame smaller. I'm pretty new to GUI layout and wxPython, so hopefully I'm doing something obviously wrong. Here's a short runnable code sample showing my basic layout (I'm using python...
4
6594
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 = wx.Panel(self,-1) self.button = wx.Button(self.panel,-1,"Klikkerdeklik") self.button.SetPosition((200,40)) self.Bind(wx.EVT_BUTTON, self.VeranderLabel, self.button)
1
1962
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 works fine until I Clear and re-fill the sizer a few times, then it puts all of the text in the upper-left corner. I can clear/refill the grid to my hearts contents but it doesn't fix itself. However, if I resize the main window the next...
1
1130
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 a tinker with wxPython and it all seems standard enough but I was wondering if anyone has any comments about how easy it is to shoehorn some fairly complex scripts into a GUI so that non-scripters can use the code. I assume I'll need to recode up...
5
2606
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 ListCtrl which adds a new item. This works fine or small searches, but when the results number in the hundreds, the GUI is frozen for the duration of the search. I suspect that so many search results are coming in that the GUI thread is too busy...
1
2676
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 way to achieve it? Thanks in advance.
16
2407
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 in particular, but I am curious to know why some people find it "ugly" or "bad" or whatever. It has its own bugs and missing features, of course, but it is one of the major GUI player in the arena, together with PyQt and PyGTK.
0
8821
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8718
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9340
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9103
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5967
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.