Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > wxPython: how to update a panel content/layout according to a variable content

Reply
Thread Tools

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

 
 
Lo?c Mah?
Guest
Posts: n/a
 
      11-19-2004
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.

Loc
 
Reply With Quote
 
 
 
 
F. GEIGER
Guest
Posts: n/a
 
      11-20-2004
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?" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) om...
> 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.
>
> Loc



 
Reply With Quote
 
 
 
 
Lo?c Mah?
Guest
Posts: n/a
 
      11-29-2004
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.

Loc


"F. GEIGER" <(E-Mail Removed)> wrote in message news:<cnno7u$3c9$(E-Mail Removed)>...
> 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
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
resize iframe according to content Zarkas Javascript 12 06-17-2010 09:35 AM
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
resizing iframe height according to its content in firefox visu Javascript 3 03-01-2007 02:28 AM
Change content according to host site David Segall HTML 1 03-17-2006 03:02 PM



Advertisments