473,586 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wxPython: how to update a panel content/layout according to a variable content

Hello

I have a problem to update the content of a wx.Panel already displayed
after changing a variable, used to define the wx.Panel content.

I have the following elements in my code:

DataList: is a list containing some data

CustomPanel: is a derived class of wx.Panel,
it contains one sizer which contains a smaller panel for each
element of the DataList list
After having displayed CustomPanel on the screen, the elements in
DataList change (after a user action like clicking on button)

I would like to refresh the CustomPanel to take into account the
changes of the DataList list
Is there a kind of Refresh/Update function which could update the
CustomPanel so
that evry sizers and panles contained by this CustomPanel are redrawn
according to the current value of DataList ?
or do you have to write your own update/refresh method for Panel and
Windows objects ?
and are you obliged to detroy the CustomPanel object and re-create a
new one?
I would appreciate any hint/reference to do this, and also a code
sample if possible.

Thanks.

Loïc
Jul 18 '05 #1
2 3434
wxWindow has Update and Refresh methods. You can override the one of your
wxPanel, where you can call all its children to update/refresh themselves.
wxPanel's update could be triggered by a timer event, mouse event or
whatever.

I do such things preferably in timers owned by the widgets themselves.

HTH
Franz GEIGER

"Lo?c Mah?" <lo*******@free .fr> schrieb im Newsbeitrag
news:27******** *************** ***@posting.goo gle.com...
Hello

I have a problem to update the content of a wx.Panel already displayed
after changing a variable, used to define the wx.Panel content.

I have the following elements in my code:

DataList: is a list containing some data

CustomPanel: is a derived class of wx.Panel,
it contains one sizer which contains a smaller panel for each
element of the DataList list
After having displayed CustomPanel on the screen, the elements in
DataList change (after a user action like clicking on button)

I would like to refresh the CustomPanel to take into account the
changes of the DataList list
Is there a kind of Refresh/Update function which could update the
CustomPanel so
that evry sizers and panles contained by this CustomPanel are redrawn
according to the current value of DataList ?
or do you have to write your own update/refresh method for Panel and
Windows objects ?
and are you obliged to detroy the CustomPanel object and re-create a
new one?
I would appreciate any hint/reference to do this, and also a code
sample if possible.

Thanks.

Loïc

Jul 18 '05 #2
Thanks for the answer.

I will try the method you talked about.

For the moment, I am creating a new sizer and new panel
and call the SetSizer(...) and SetAutoLayout(. ..)
but this is not satisfying me.

Loïc
"F. GEIGER" <f.******@vol.a t> wrote in message news:<cn******* ***@newsreader1 .utanet.at>...
wxWindow has Update and Refresh methods. You can override the one of your
wxPanel, where you can call all its children to update/refresh themselves.
wxPanel's update could be triggered by a timer event, mouse event or
whatever.

I do such things preferably in timers owned by the widgets themselves.

HTH
Franz GEIGER

Jul 18 '05 #3

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

Similar topics

15
2893
by: Grant Edwards | last post by:
Can anybody recommend a good book on wxPython? Are there any books on wxPython? I've been trying to learn wxPython and/or wax for a few weeks, and I'm just not getting it. wxWindows seems to be more low-level than the other GUI toolkits I've used (Tk, GTK, and Trestle), and there are all sorts exposed details in wxWindows/wxPython...
1
6003
by: Piet | last post by:
Hello, I am still struggling with a dynamic dialog box. I have created a dialog box that will show a variable number of controls depending on a selection made in a ComboBox also present in the frame. The dialog box is not derived from wxDialog, but from a wxFrame. The dialog is initialized as follows: class myDialog(wxFrame): def...
1
2150
by: mdk.R | last post by:
Hello all: i'am installed wxPython 2.5 and Python2.3.4..i try execute script with wxPython but it show error: Traceback (most recent call last): File "E:\py\test.py", line 7, in ? import wx File "E:\py\wx.py", line 10, in ? from wxPython.wx import * File "D:\Python23\Lib\site-package import _wx
1
1899
by: py | last post by:
I have the following code: class MainFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, wx.ID_ANY, title, style=wx.DEFAULT_FRAME_STYLE |wx.NO_FULL_REPAINT_ON_RESIZE) # build top area topSizer = self.buildTopPanel() # build input area inputSizer = self.buildInputPanel()
3
3207
by: John Salerno | last post by:
I'm using the sample code of the file 'simple.py' and trying to make a single window with a panel in it, but I keep getting an error. Here's my code: (I know I might need something else, like a Show() method for the panel, but the error stops on the first panel line anyway. I've tried a Layout() method but it didn't get that far). import wx...
9
5520
by: zxo102 | last post by:
Hi everyone, I am using a python socket server to collect data from a socket client and then control a image location ( wxpython) with the data, i.e. moving the image around in the wxpython frame. But the "app.MainLoop()" in wxpython looks like conflicting with the "while 1:" in socket server. After I commented the "app.MainLoop()",...
9
4417
by: Tyler | last post by:
Hello All: I am currently working on a project to create an FEM model for school. I was thinking about using wxPython to gather the 12 input variables from the user, then, after pressing the "Run" button, the GUI would close, and the 12 input variables would then be available for the rest of the program. So far, what I have been able to...
4
1922
by: Jimmy | last post by:
Hi, wxPython is cool and easy to use, But I ran into a problem recently when I try to write a GUI. The thing is I want to periodically update the content of StatixText object, so after create them, I pack them into a list...the problem comes when I later try to extract them from the list! I don't know why? my code is as following: import...
3
2302
by: Soren | last post by:
Hi, Id like to make my own special listbox.. I want to able (at the push of a button) to add another item to my special listbox... each item is a panel with a label, some buttons and maybe a text control. I've tried adding a new panel object with the stuff i want to the sizer i'm using for my listbox (which is a panel which can contain...
0
7836
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...
0
8199
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. ...
1
7950
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...
0
8212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6606
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...
0
5389
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...
0
3835
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...
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.