Hi Guys! I'm new here & also new to Perl world.. Actually I'm an Electronics Engineer (ASIC Design) & I started playing with Perl/TK as I need to build a GUI tool for running my simulations.. Please take a look at the below: I've built a little MainWindow in which I can open several Tabs NoteBooks). Each Tab is differently named by the user and should consist its own Button. The problem is that I do not know how to "tie" the Buttons into the Page (Tab) they displayed on i.e. If you open a Tab labeled "1" & click Buttons "Option1" & "Option3", and now you open a new Tab labeled "2" - you'll see that Buttons "Option1" & "Option3" are activated... How do I grant a unique variable to Buttons of each Page? Best Regards, Ronen

#!/usr/local/bin/perl use Tk; use Tk::NoteBook; use Tk::DialogBox; use Tk::LabEntry; $mw = MainWindow->new(); $mw->title("TEST"); $mw->geometry( "400x300"); $mw->configure(-menu => my $menubar = $mw->Menu); my $file = $menubar->cascade(-label => '~File'); $file->command( -label => 'New Test', -underline => 0, -command => \&new_test, ); $file->separator; # -------------------------------------------------------------------- +--------------------------- ## Create the notebook and fill the whole window $nb = $mw->NoteBook()->pack(-expand => 1, -fill => 'both'); MainLoop; # Open new Single Test Run Tab subroutine sub new_test { # Popup for selecting name for new Tab $db = $mw->DialogBox(-title => "Select Test Name", -buttons => ["OK", +"Cancel"]); $db->add('LabEntry', -textvariable => \$test_name, -width => 20, -label => 'Test Label:', -labelPack => [-side => 'left'])->pa +ck; $db->Show( ); # Create the notebook and fill the whole window # Page 1 on the Notebook, with buttons on that page $p1 = $nb->add($test_name, -label => $test_name); $lbl_0 = $p1 -> Label(-text=>"$test_name Options:") -> place(-x => 0, +-y => 100); $rdb_1 = $p1 -> Checkbutton(-text=>"Option1", -variable=>\$option1) -> + place(-x => 100, -y => 100); $rdb_2 = $p1 -> Checkbutton(-text=>"Option2", -variable=>\$option2) -> + place(-x => 100, -y => 120); $rdb_3 = $p1 -> Checkbutton(-text=>"Option3", -variable=>\$option3) -> + place(-x => 100, -y => 140); }

In reply to Perl/TK NoteBook Q. by ronene1972

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.