Re: passing data to Tkinter call backs

2010-06-09 Thread rantingrick
On Jun 9, 4:23 am, Nick Keighley wrote: > 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? I don't know "how" you're triggering redraws but you need to

Re: passing data to Tkinter call backs

2010-06-09 Thread Bruno Desthuilliers
Nick Keighley a écrit : On 9 June, 13:50, Bruno Desthuilliers (snip) Note that the lambda trick you used is very idiomatic - functool.partial being newer and probably not as used - so one could argue that the most common way is also the most "elegant" !-) I'm somewhat newbie at Python but I'd

Re: passing data to Tkinter call backs

2010-06-09 Thread Nick Keighley
On 9 June, 13:50, Bruno Desthuilliers wrote: > Nick Keighley a écrit : > > > > > > > On 9 June, 10:35, Bruno Desthuilliers > 42.desthuilli...@websiteburo.invalid> wrote: > >> Nick Keighley a crit : > > >>> I'm trapping mouse clicks using > >>> canvas.bind("", mouse_clik_event) > >>> def mouse_cli

Re: passing data to Tkinter call backs

2010-06-09 Thread Bruno Desthuilliers
Nick Keighley a écrit : On 9 June, 10:35, Bruno Desthuilliers wrote: Nick Keighley a crit : I'm trapping mouse clicks using canvas.bind("", 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 pas

Re: passing data to Tkinter call backs

2010-06-09 Thread Nick Keighley
On 9 June, 10:35, Bruno Desthuilliers wrote: > Nick Keighley a crit : > > I'm trapping mouse clicks using > > > canvas.bind("", 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

Re: passing data to Tkinter call backs

2010-06-09 Thread Bruno Desthuilliers
Nick Keighley a écrit : Hi, If this is the wrong place for Tkinter in python please direct me elsewhere! I'm trapping mouse clicks using canvas.bind("", mouse_clik_event) def mouse_clik_event (event) : stuff What mouse_clik_event does is modify some data and trigger a redraw. Is there a

passing data to Tkinter call backs

2010-06-09 Thread Nick Keighley
Hi, If this is the wrong place for Tkinter in python please direct me elsewhere! I'm trapping mouse clicks using canvas.bind("", 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