Sujet : Re: How to pass an object from inside its own method to a helper function
De : mark (at) *nospam* qtrac.eu (Mark Summerfield)
Groupes : comp.lang.tclDate : 11. Jul 2024, 12:42:36
Autres entêtes
Message-ID : <1C6dnZup-smxWBL7nZ2dnZfqnPudnZ2d@brightview.co.uk>
References : 1 2 3
User-Agent : Pan/0.154 (Izium; 517acf4)
On Thu, 11 Jul 2024 13:12:52 +0200, Schelte wrote:
[snip]
Or less hacky:
proc make_file_menu {app} {
.menu.file add command -command [list $app on_quit] \
-label Quit -underline 0 -accelerator Ctrl+Q
}
Originally you had $app inside curly braces, which prevented it from
being substituted at definition time. At execution time, the app
variable was out of scope.
Thank you, that works great.