Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
But i am reveiving the below error messageuse Tk; use strict; my $mw = new MainWindow; #Making a text area my $txt = $mw -> Scrolled('Text',-width => 30,-scrollbars=>'e') -> pac +k (); #Declare that there is a menu my $mbar = $mw -> Menu(); $mw -> configure(-menu => $mbar); my $others = $mbar -> cascade(-label =>"Main", -underline=>0, -tearoff + => 0); my $help = $mbar -> cascade(-label =>"Help", -underline=>0, -tearoff = +> 0); ## Others Menu ## my $insert = $others -> cascade(-label =>"Insert", -underline => 0, -t +earoff => 0); my $Btn1 = $insert -> command(-label =>"Name"); my $Btn2 = $insert -> command(-label =>"Website"); my $Btn3 = $insert -> command(-label =>"Email"); $others-> command(-label => "Delete", -underline=>0, -command=>sub {delete_menu();} ); MainLoop; sub delete_menu { $Btn1-> delete(0); }
Tk::Error: Can't locate object method "delete" via package "Tk::Menu:: +Button"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Deleting Menu Item from Menu
by zentara (Cardinal) on Jan 28, 2009 at 14:38 UTC | |
by Anonymous Monk on Jan 28, 2009 at 15:59 UTC | |
by zentara (Cardinal) on Jan 28, 2009 at 19:27 UTC | |
by zentara (Cardinal) on Jan 28, 2009 at 16:15 UTC | |
|
Re: Deleting Menu Item from Menu
by Anonymous Monk on Jan 28, 2009 at 13:50 UTC | |
by Anonymous Monk on Jan 28, 2009 at 14:11 UTC | |
by Anonymous Monk on Jan 28, 2009 at 14:25 UTC |