Suppose you are writing a GUI application. You don't want to write it from scratch so you want to use TKInter or WXPython. However, you also want to process the user's mouse clicks. These clicks won't occur in a consistent manner; sometimes they may occur frequently (double-clicking), sometimes infrequently (they're busy reading your interface, whatever.) So if you just poll the TKInter side of the program for events, a lot of the polls will be wasted. What you really want is that your code is run only when your event occurs.So you write a program that does what you want on each mouse click. Then you pass it to TKInter and say "hey, call this whenever you get a mouseclick event!" that function you wrote is called a "callback".
Make sense? On Wed, Aug 26, 2009 at 8:47 PM, Jramak <[email protected]> wrote: > Hello > > I'm confused by callbacks. I would really appreciate any introduction or > help in understanding the concept of callbacks. > > Thanks much > Jramak > > _______________________________________________ > Tutor maillist - [email protected] > http://mail.python.org/mailman/listinfo/tutor > >
_______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
