FAQ
Ok i have a wxFrame with a wxNotebook that has two wxPanels, lets call
them panel_1 and panel_2

i have wxTextCtrl in panel_1 (call it panel_1_ctrl) that i want the
user to be able to fill up. I then want the user to be able to click a
button (i.e. create an EVT) and have Value() of panel_1_ctrl be sent a
wxTextCtrl in panel_2.

So can i do this directly, i.e. is there a way to tell panel_2 that
something has happended in panel_1 and to send panel_2 that data? Or do
i have to go through the wxFrame i.e (panel_1 tells wxFrame that EVT
happened, wxFrame then tells panel_2).


in short panel_1_ctrl sends Value() to panel_2_ctrl.



Thanks for any help that you can give me.

Search Discussions

  • Support Services Complaints at Mar 19, 2005 at 11:53 am
    well i have gotten to the point that i can send msgs one way by passing
    the to panel (panel_2 in example) as a param to __init__ of the from
    panel (panel_1)
  • F. GEIGER at Mar 19, 2005 at 2:52 pm
    That's the Visual Basic way to do it.

    I prefer it this way:

    Controls work on models. If a control has to store a value it does so by
    calling MyDataPool.storeMyValue(self.GetValue()).

    When the NotebookPage is changed, the new page tells all controls to update
    themeselves: self.SetValue(str(MyDataPool.myValue())).

    Recently I even prefer controls doing that by theirselves. They all have a
    timer, to periodically check whether or not they have to update themselves.
    But such a design is necessary only if the controls display current values,
    coming e.g. from an OPC server.

    HTH
    Franz GEIGER



    <support.services.complaints at gmail.com> schrieb im Newsbeitrag
    news:1111224663.847097.208820 at o13g2000cwo.googlegroups.com...
    Ok i have a wxFrame with a wxNotebook that has two wxPanels, lets call
    them panel_1 and panel_2

    i have wxTextCtrl in panel_1 (call it panel_1_ctrl) that i want the
    user to be able to fill up. I then want the user to be able to click a
    button (i.e. create an EVT) and have Value() of panel_1_ctrl be sent a
    wxTextCtrl in panel_2.

    So can i do this directly, i.e. is there a way to tell panel_2 that
    something has happended in panel_1 and to send panel_2 that data? Or do
    i have to go through the wxFrame i.e (panel_1 tells wxFrame that EVT
    happened, wxFrame then tells panel_2).


    in short panel_1_ctrl sends Value() to panel_2_ctrl.



    Thanks for any help that you can give me.
  • MyHaz at Mar 19, 2005 at 10:39 pm
    so you run data pool as like a sruct that contains all your global
    objects? That sounds like an iteresting way of doing things. i try to
    stay away from gloabs as much as possible but this might be a good time
    to queue up that particular tool

    thanks for your reply
  • F. GEIGER at Mar 21, 2005 at 6:26 am
    My DataPool then is a singleton, well, actually, a Borg. See Alex Martelli's
    recipe for that. If you use new style classes, then you have to look for
    "Singleton" in the cookbook.

    HTH
    Franz GEIGER


    "MyHaz" <support.services.complaints at gmail.com> schrieb im Newsbeitrag
    news:1111271984.207122.191160 at f14g2000cwb.googlegroups.com...
    so you run data pool as like a sruct that contains all your global
    objects? That sounds like an iteresting way of doing things. i try to
    stay away from gloabs as much as possible but this might be a good time
    to queue up that particular tool

    thanks for your reply

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMar 19, '05 at 9:31a
activeMar 21, '05 at 6:26a
posts5
users2
websitepython.org

2 users in discussion

MyHaz: 3 posts F. GEIGER: 2 posts

People

Translate

site design / logo © 2022 Grokbase