I am trying to work out NoteBook tabs and how to dynamically create and destroy them, however with this particular function, I'm getting the error:

page nmap3 does not exist at /home/thefinn/workspace/Rasputin/nmap.module.pl line 57

The code is working fine other than the button to destroy the tab.

Any new hints on counting up tabs and dealing with tab methods welcome.

Thanks,
Peter.

sub nmap_scan_dialog { $tabcount++; $mytab="nmap$tabcount"; $nmap{$tabcount}=$tabsinside->add($mytab,-label => "Nmap Scan")->p +ack(); $tabsinside->Resize(); #Bug workaround. $thistab=$mytab->Frame(-background => 'black', -foreground => '#00ff00')->pack(-side => 'top', -fill => 'x'); $thistab->Label(-text => 'New Nmap Scan', -background => 'black', -foreground => '#00ff00')->pack(); $nsleft=$thistab->Frame(-background => 'black', -foreground => '#00ff00')->pack(-side=> 'left', -pady=>9, -padx => +8); $nsask1=$nsleft->Label (-text => 'Network Name:', -background => ' +black', -foreground => '#00ff00')->pack(); $nsask2=$nsleft->Label (-text => 'Target Adddress:', -background = +> 'black', -foreground => '#00ff00')->pack(); $nsask3=$nsleft->Label (-text => 'Extra Nmap Flags:', -background +=> 'black', -foreground => '#00ff00')->pack(); $nsright=$thistab->Frame(-background => 'black', -foreground => '#00ff00')->pack(-side => 'left', -pady => 2, -padx +=>15); $nsask1=$nsright->Entry (-background => '#00FF00', -foreground => 'black', -width=>12, -borderwidth=>2, -relief => 's +unken')->pack(); $nsask2=$nsright->Entry (-background => '#00ff00', -foreground => 'black', -width=>12, -borderwidth=>2, -relief => 's +unken')->pack(); $nsask3=$nsright->Entry (-background => '#00ff00', -foreground => 'black', -width=>12, -borderwidth=>2, -relief => 's +unken')->pack(); $nsbut2=$thistab->Button(-text => 'Cancel', -background => 'red', -foreground => 'black', -command => sub { $tabsinside->delete($mytab); })->pack( -side => 'right', -pady =>2, -anchor => 'w'); $nsbut1=$thistab->Button(-text => 'Start', -background => '#00FF00 +', -foreground => 'black', -command => sub { &nmap_scan() } )->pack( -side => 'right', -pady => 2, -anchor => 'w'); }

In reply to Dynamic tab creation/destuction with Tk::Notebook by thefinn

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.