From: John H. <ec...@ya...> - 2008-01-06 23:43:48
|
If that's all you want to do, then it's simply. Just make a call to that event handler. For instance: def on_button1_mouseClick(self, event): self.on_button2_mouseClick(event) The only trap about doing this is that the event structure is really that of button1 - not button2. So, if you are using code inside on_button2_mouseClick such as: event.target.enabled=False instead of say: self.components.button2.enabled=False then you would be in trouble. That's why simulating an event by pushing an event into the event queue is by far the safer way to do it. Sorry but I have to research this a bit to try to refresh my memory on how to do it that way. But for now, I think this should work for you unless you're doing things more advanced. --- Tony Cappellini <cap...@gm...> wrote: > I've got a combo box update event handler that is > called when the user > makes a selection in the combo box. > When the event handler is called, other controls are > updated accordingly. > > However, this only occurs when the screen is > visible, and the user > makes a selection. > > During initialization, I want to select a default > item in the combo > box, and I want the other controls to be updated > accordingly, just as > if the user had made the selection. Sure, I can > manually add code to > do this, but it seems like it's better to jsut use > the built in event > handlers, and simulate a selection in the combo box, > so I dont need to > duplicate the code which updates the other controls. > > Does this explain the issue more clearly? > > thanks > > On Jan 6, 2008 2:38 PM, John Henry > <ec...@ya...> wrote: > > I kind of get what you are trying to do but just > to be > > sure, can you elaborate a bit because I might be > able > > to answer it. I do a lot of creating controls > such as > > buttons on the fly. > > > > --- Tony Cappellini <cap...@gm...> wrote: > > > > > I have a Radio Group with two buttons in it. > > > I can't call the event handler programmatically > > > because event needs to > > > be passed. > > > > > > When I tried setting one of the radio buttons > > > programmatically, the > > > event handler never was called. > > > > > > How can I force the event to be generated by > setting > > > one of the > > > buttons programmatically? > > > > > > thanks > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by: Microsoft > > > Defy all challenges. Microsoft(R) Visual Studio > > > 2005. > > > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > _______________________________________________ > > > Pythoncard-users mailing list > > > Pyt...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > > > > > > > > > -- > > John Henry > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio > 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > -- John Henry |