Morning Greetings Brother Monks, Today's question is as follow: I have two levels of sub menus and now I've created a third level of submenus. I have no problems going from submenu one back to the Toplevel menu or going from submenu two back to submenu one it is when submenu three goes back to submenu two is the issue. Yes I do use "strict, warnings and diagnostics" at the beginning of my code. Code and Error posted below thanks in advance!

sub addmanifest { my $perInfo9 = {NAME => '', TOWNS => '', TRAILER => ''}; my $addmn = $mw->Toplevel(); $addmn->group($mw); $addmn->resizable(0,0); # Create the main window $addmn->configure(-title=>'Add Manifest'); $addmn->geometry('285x270+0+0'); my $personInfo9 = $addtmn->Frame()->pack(-side=>'top',-fill=>'x'); my $personLeft9 = $personInfo9->Frame()->pack(-side=>'left',-fill=>' +x'); my $personRight9 = $personInfo9->Frame()->pack(-side=>'left',-fill=>' +x',-padx=>20,-pady=>20); $personLeft9->Label(-text=>'Manifest Information')->pack(); $personLeft9->Label(-text=>'')->pack(); $personLeft9->Label(-text=>'Manifest Name')->pack(); $personLeft9->Label(-text=>'Manifest Towns')->pack(); $personLeft9->Label(-text=>'Manifest Trailer')->pack(); $personRight9->Label(-text=>'')->pack(); $personRight9->Label(-text=>'')->pack(); $personRight9->Entry(-width=>20,-borderwidth=>2, -relief=>'sunken',-textvariable=>\$perInfo9->{NAME})->pack(); $personRight9->Entry(-width=>20,-borderwidth=>2, -relief=>'sunken',-textvariable=>\$perInfo9->{TOWNS})->pack(); $personRight9->Entry(-width=>20,-borderwidth=>2, -relief=>'sunken',-textvariable=>\$perInfo9->{TRAILER})->pack(); my $saveFrame9 = $addmn->Frame()->pack(-side=>'top',-fill=>'x'); $saveFrame9->Button(-text => 'Add Manifest', -command => sub { open(OUT,">>DATA/manifestdata.txt"); print OUT "" . $perInfo9->{NAME} . ":"; print OUT "" . $perInfo9->{TOWNS} . ":"; print OUT "" . $perInfo9->{TRAILER} . "\n"; close(OUT); sleep 2; $addmn->withdraw; $mm->deiconify; # THIS IS SUB MENU TWO IT HAS TO BE SUBMENU THREE HOW +EVER THE BELOW ERROR OCCURS when $mm is used, I have to use $opsm in +order for it to work correctly } )->grid(-row, 2, -column, 0, -sticky => 'nesw'); $balloon->attach($saveFrame9, -balloonmsg => "Return To Add Manifest") +; } # END __ERROR__ Tk::Error: Can't call method "deiconify" on an undefined value at C:\U +SER\PERL\PROGRAM\test-gui.pl line 3995. Tk callback for .toplevel3.frame1.button Tk::__ANON__ at C:/Perl/site/lib/Tk.pm line 250 Tk::Button::Invoke at C:/Perl/site/lib/Tk/Button.pm line 200 <Key-Return> (command bound to event)

In reply to TK Submenus by PilotinControl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.