View Single Post
Old Feb 19th, 2007, 6:19 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,868
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Yeah... ptmcg's response is definitely going overboard. Not to mention, most likely not even applicable under these circumstances

If it were wxWidgets, it would be as simple as this:

class MyFrame(wxFrame):
    
    ...

    def _event_okay(self, event=None):
        # processes task for okay button
        if event != None:
            event.skip()

    def _event_quit(self, event=None):
        # processes task for quit button
        if event != None:
            event.skip()

    def _event_other_button(self, event):
        # processes two tasks sequentially
        self._event_okay()
        self._event_quit()
        event.skip()

    ...

Unless I grossely misunderstand the concern?
...
Sane is offline   Reply With Quote