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

Discussion in 'Python' started by Lo?c Mah?, Nov 19, 2004.

  1. Lo?c Mah?

    Lo?c Mah? Guest

    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
    Lo?c Mah?, Nov 19, 2004
    #1
    1. Advertising

  2. Lo?c Mah?

    F. GEIGER Guest

    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?" <> schrieb im Newsbeitrag
    news:...
    > 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
    F. GEIGER, Nov 20, 2004
    #2
    1. Advertising

  3. Lo?c Mah?

    Lo?c Mah? Guest

    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" <> wrote in message news:<cnno7u$3c9$>...
    > 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?, Nov 29, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick Spiewak
    Replies:
    3
    Views:
    3,147
    Rick Spiewak
    Aug 26, 2003
  2. Replies:
    1
    Views:
    571
    John Timney \(MVP\)
    Jun 19, 2006
  3. DanWeaver
    Replies:
    2
    Views:
    560
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Feb 22, 2007
  4. Chris

    Grid Layout Panel and Panel in the Designer

    Chris, Aug 28, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    197
    Chris
    Aug 28, 2003
  5. Sven Fischer
    Replies:
    0
    Views:
    465
    Sven Fischer
    Oct 22, 2012
Loading...

Share This Page