passing data to Tkinter call backs

Nick Keighley nick_keighley_nospam at hotmail.com
Wed Jun 9 05:23:54 EDT 2010


Hi,

If this is the wrong place for Tkinter in python please direct me
elsewhere!

I'm trapping mouse clicks using

canvas.bind("<ButtonRelease-1>", mouse_clik_event)

def mouse_clik_event (event) :
     stuff

What mouse_clik_event does is modify some data and trigger a redraw.
Is there any way to pass data to the callback function? Some GUIs give
you a user-data field in the event, does Tkinter?

Or am I reduced to using <spit> global data? A Singleton is just
Global Data by other means.


--
Nick Keighley

This led to packs of feral Global Variables roaming the
address space.



More information about the Python-list mailing list