Below is some sample code which I hope will illustrate the problem I am
facing.
#!/usr/local/ActivePerl-5.6/bin/perl5.6.1 -w
use Tk;
use Tk::Dialog;
use strict;
##################################################
my $mw = MainWindow->new;
use subs qw/file_menuitem/;
$mw->configure(-menu=>my $menubar=$mw->Menu);
my $file = $menubar->cascade(
-label => 'File', -menuitems=>file_menuitem);
print $file->cget(-label); # just to make sure I can am using cget
correctly.
MainLoop;
# In the following subroutine, asssume I do not know the -label value
is 'Save' and that I want to print the -label value with the subroutine
#defined with -command, as perhaps in the following
sub file_menuitem{
[
['command', 'Save', -command=>sub { print whatever the -label value
is. \n"}],
]
}
How can I have the -command subroutine find out the -label value, I
have tried a number of things, all naive, and all of which did not work.
Thanks for any help. This problem has really stumped me.
Dick Fell
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]