jdtoronto has asked for the wisdom of the Perl Monks concerning the following question:
I have a Perl/Tk application (which many here have helped with!) where I face an interesting dilemna.
In this code I wish to 'load' the list by calling a sub when the 'arrow' button is clicked. Naturally I would like to pass the variables in to the sub. But before the sub can know where to 'insert' the data it must have the handle for the widget! Now this is a case of the dog chasing its tail. I can't use the handle in the call to the sub till it has a value.$pgl->Label(-text => 'Project', -justify => 'right', -width => '20 +') ->grid($pr_list = $pgl->BrowseEntry(-variable => \$state-> +{prSrcName}, -browsecmd => \&doGetProject, -listcmd => [ \&doLoadPr, +$dbh, $pr_list ], -width => '20'), -sticky => 'w', -pady => '20');
So, is it possible to pass the widget handle to a sub, from the the widget?
I know I can do it by making the widget handle a global, but hey I just don't wanna go down that road if I can avoid it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk BrowseEntry -listcmd problem
by fletcher_the_dog (Friar) on Aug 27, 2003 at 17:06 UTC | |
by jdtoronto (Prior) on Aug 27, 2003 at 17:23 UTC | |
by converter (Priest) on Aug 27, 2003 at 21:02 UTC |