Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • XRC panel updates?

    6 answers - 660 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi all,
    I can create and display a panel from XRC no problem.
    Now I want to go to the advanced stuff, I have defined several panels in
    my XRC file and at some point I want to display one of the other panel
    descriptions in its stead.
    I already found out that simply doing a new LoadPanel with the same
    parameters except for the object name does not work.
    Same with a Destroy() on the result of the earlier LoadPanel action.
    Now the panel is used as the content of a Notebook tab so that further
    complicates matters, unless I am mistaken of course.
    What is the way that does yield the desired effect?
    Paul
  • No.1 | | 1136 bytes | |

    Paul Sijben wrote:
    Hi all,

    I can create and display a panel from XRC no problem.

    Now I want to go to the advanced stuff, I have defined several panels in
    my XRC file and at some point I want to display one of the other panel
    descriptions in its stead.

    I already found out that simply doing a new LoadPanel with the same
    parameters except for the object name does not work.
    Same with a Destroy() on the result of the earlier LoadPanel action.

    Now the panel is used as the content of a Notebook tab so that further
    complicates matters, unless I am mistaken of course.

    What is the way that does yield the desired effect?

    It depends on the situation, but one way is to load all panels and
    Hide() the ones you don't need at the moment. When you need to switch
    then do a Show of the new one and a Hide on the old one. Depending on
    how you are doing your layout then you may need to do something to get
    the new panel sized and positioned right.

    For notebook tabs you will need to remove the page from the notebook and
    insert the new one in it's place.
  • No.2 | | 1447 bytes | |

    Thanks I will try these tomorrow!

    Robin Dunn wrote:
    Paul Sijben wrote:
    >Hi all,
    >>

    >I can create and display a panel from XRC no problem.
    >>

    >Now I want to go to the advanced stuff, I have defined several panels in
    >my XRC file and at some point I want to display one of the other panel
    >descriptions in its stead.
    >>

    >I already found out that simply doing a new LoadPanel with the same
    >parameters except for the object name does not work.
    >Same with a Destroy() on the result of the earlier LoadPanel action.
    >>

    >Now the panel is used as the content of a Notebook tab so that further
    >complicates matters, unless I am mistaken of course.
    >>

    >What is the way that does yield the desired effect?
    >

    It depends on the situation, but one way is to load all panels and
    Hide() the ones you don't need at the moment. When you need to switch
    then do a Show of the new one and a Hide on the old one. Depending on
    how you are doing your layout then you may need to do something to get
    the new panel sized and positioned right.

    For notebook tabs you will need to remove the page from the notebook
    and insert the new one in it's place.
  • No.3 | | 2047 bytes | |

    Hi I have been beginning to look at SWIG for wrapping some other wx
    functionality that is only in C at the moment to get some other things
    not currently available in wxPython. I have been interested in a some
    capability to interface with scanners with TWAIN. Robin, can you point
    me examples of wrapping wx functionality with SWIG in the repository
    anywhere so I have somewhat something to follow. Many thanks.

    Regards,
    David

    Robin Dunn wrote:
    Paul Sijben wrote:
    >Hi all,
    >>

    >I can create and display a panel from XRC no problem.
    >>

    >Now I want to go to the advanced stuff, I have defined several panels in
    >my XRC file and at some point I want to display one of the other panel
    >descriptions in its stead.
    >>

    >I already found out that simply doing a new LoadPanel with the same
    >parameters except for the object name does not work.
    >Same with a Destroy() on the result of the earlier LoadPanel action.
    >>

    >Now the panel is used as the content of a Notebook tab so that further
    >complicates matters, unless I am mistaken of course.
    >>

    >What is the way that does yield the desired effect?


    It depends on the situation, but one way is to load all panels and
    Hide() the ones you don't need at the moment. When you need to switch
    then do a Show of the new one and a Hide on the old one. Depending on
    how you are doing your layout then you may need to do something to get
    the new panel sized and positioned right.

    For notebook tabs you will need to remove the page from the notebook and
    insert the new one in it's place.

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.4 | | 1686 bytes | |

    I have found the calls I'd need to remove the tab and recreate it.
    However, is there a more elegant way of finding out the tab page number
    of my panel besides looping over all numbers and calling |GetPage until
    it returns the handle to my panel.

    Paul
    |
    Robin Dunn wrote:
    Paul Sijben wrote:
    >Hi all,
    >>

    >I can create and display a panel from XRC no problem.
    >>

    >Now I want to go to the advanced stuff, I have defined several panels in
    >my XRC file and at some point I want to display one of the other panel
    >descriptions in its stead.
    >>

    >I already found out that simply doing a new LoadPanel with the same
    >parameters except for the object name does not work.
    >Same with a Destroy() on the result of the earlier LoadPanel action.
    >>

    >Now the panel is used as the content of a Notebook tab so that further
    >complicates matters, unless I am mistaken of course.
    >>

    >What is the way that does yield the desired effect?
    >

    It depends on the situation, but one way is to load all panels and
    Hide() the ones you don't need at the moment. When you need to switch
    then do a Show of the new one and a Hide on the old one. Depending on
    how you are doing your layout then you may need to do something to get
    the new panel sized and positioned right.

    For notebook tabs you will need to remove the page from the notebook
    and insert the new one in it's place.
  • No.5 | | 459 bytes | |

    Paul Sijben wrote:
    I have found the calls I'd need to remove the tab and recreate it.
    However, is there a more elegant way of finding out the tab page number
    of my panel besides looping over all numbers and calling |GetPage until
    it returns the handle to my panel.

    If you are always dealing with the current page then you can use
    GetSelection. you could make a dictionary when you add pages and use
    that to get back to the index.
  • No.6 | | 771 bytes | |

    Thanks for all the help it works now. As I can not assume the panel is
    active (I got asynchronous events all over the place in my app) and I do
    not want to trust the dictionary (for the same reason), I just looped
    over the tabs.

    Robin Dunn wrote:
    Paul Sijben wrote:
    >I have found the calls I'd need to remove the tab and recreate it.
    >However, is there a more elegant way of finding out the tab page
    >number of my panel besides looping over all numbers and calling
    >|GetPage until it returns the handle to my panel.
    >

    If you are always dealing with the current page then you can use
    GetSelection. you could make a dictionary when you add pages and
    use that to get back to the index.

Re: XRC panel updates?


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 2 =
QUESTION ON "Python"

EMSDN.COM