A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/098515.html below:

Changing global variables in tkinter/pmw callback

Changing global variables in tkinter/pmw callbackBrian Elmegaard be at mek.dtu.dk
Wed Apr 11 05:02:18 EDT 2001
Alex Martelli wrote:
> 
> Which would become, to be literal in the transliteration:
> 
>     def configure_command(self=self, button=button,
>             buttons=self.buttons, setting=CurrentCanvasSetting):
>         self.apply(button, buttons, setting)
> 
>     button.configure(command = configure_command)

So that's the way. I see.

> Here, if I understand correctly, what you're trying to do
> is somehow set an appropriate "global" string when a
> function is executed.  If that CurrentCanvasSetting is

yes.
> 
>     def apply(self, button, modobj, varname):
>         setattr(modobj, varname, button.cget('text'))

Ahh. But still it's not really like assigning to a global...

Thanks again, Alex.

-- 
Brian
http://www.et.dtu.dk/energysystems
http://www.rk-speed.dk http://fiduso.dk http://sunsite.auc.dk/dk-tug
\TeX, tak

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4