halfcountplus has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use Tk; my $MW = MainWindow->new; my $menu = $MW -> Menu(-type=>'menubar',-tearoff=>0); $MW -> configure(-menu=>$menu); $MW -> bind("<Key-F1>"=>[\&printentry]); my $MM = $menu -> cascade(-label=>'menu',-underline=>0,-tearoff=>0); my $one = $MM -> command(-label=>'one',-command=>sub{}); my $two = $MM -> command(-label=>'two',-command=>sub{}); my $three = $MM -> command(-label=>'three',-command=>sub{}); MainLoop; sub printentry { my $whM = $menu->entrycget('active','-label'); print "active:$whM\t"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk! (entrycget w/ 'active')
by eserte (Deacon) on Mar 08, 2008 at 13:44 UTC | |
by halfcountplus (Hermit) on Mar 09, 2008 at 15:40 UTC | |
by eserte (Deacon) on Mar 10, 2008 at 23:02 UTC | |
|
Re: Tk! (entrycget w/ 'active')
by Anonymous Monk on Mar 08, 2008 at 13:22 UTC |