OK, I've made changes and trimmed back to bare essentials. I am looping over the %tools hash to create tabs with parameters and defaults. So far, so good. Now, I would like to capture any user changes/inputs and write a text file consisting of: LABEL=ENTRY\n LABEL=ENTRY\n ...
#!/usr/bin/perl -w use warnings; use strict; use Tk; use Tk::NoteBook; require Tk::Pane; #use Tie::IxHash; use Tk::LabEntry; my $mw = MainWindow->new; $mw->geometry( "600x500"); $mw->title("Survival Kit"); ###program parameter hash my %tools = ( 'program1' => { 'PARM1' => 1, 'PARM2' => 'n', 'PARM3' => + 'y', 'PARM4' => 'n', 'PARM5' => 'y', 'PARM6' => 'n', 'PARM7' => 'y', + 'PARM8' => 'n', 'PARM9' => 'y', 'PARM10' => 'n' }, 'program2' => { ' +PARM1' => 1, 'PARM2' => 2, 'PARM3' => 3, 'PARM4' => 4, 'PARM5' => 5, +'PARM6' => 6, 'PARM7' => 7, 'PARM8' => 8, 'PARM9' => 9, 'PARM10' => 1 +0 }); + ## create notebook my $book = $mw->NoteBook()->pack(-expand=>1,-fill=>'both'); #####program1####### my $tab_cnt=1; for my $tab (keys %tools){ ##create tab,scroll pane,frames my $tab_tab=$book->add("Sheet $tab_cnt", -label => "$tab")->pack +(-expand=>1,-fill=>'both'); my $tab_spane=$tab_tab->Scrolled('Pane',-background=>'slate grey +')->pack(-expand=>1, -fill=>'both'); my $tab_frame1=$tab_spane->Frame(-background=>'blue')->pack(-sid +e=>'left',-expand=>1,-fill=>'both',-padx=>15); my $tab_frame2=$tab_spane->Frame(-background=>'red')->pack(-side +=>'bottom',-anchor=>'s',-fill=>'x'); $tab_cnt++; #create columns my $tab_column1 = $tab_frame1->Frame()->pack(-side=>'left',-exp +and=>1,-fill=>'both'); my $tab_column2 = $tab_frame2->Frame()->pack(-side=>'right',-ex +pand=>1,-fill=>'both'); ##now fill frames my $parm_cnt=1; print "Processing tool: $tab\n"; foreach my $parm ( keys %{$tools{$tab}}) { print " $parm = $tools{$tab}{$parm}\n"; if ($parm_cnt < 6 ){ my $tab_test=$tab_column1->LabEntry(-label => "$parm=") +; $tab_test->Subwidget('entry')->configure(-textvariable => \$t +ools{$tab}{$parm} ); $tab_test->configure(-labelPack=>[-side=>'left']); $tab_test->pack(-anchor=>'e'); } else { my $tab_test=$tab_column2->LabEntry(-label => "$parm=") +; $tab_test->Subwidget('entry')->configure(-textvariable => \$t +ools{$tab}{$parm} ); $tab_test->configure(-labelPack=>[-side=>'left']); $tab_test->pack(-anchor=>'e'); } $parm_cnt++; } #######run button############# my $run=$tab_tab->Button(-text => "\n $tab \n ", -command +=> \&run,-background=>'slate grey')->pack; } MainLoop; ####################### subs ################################# sub run { #print "Label = Entry" to file #execute program }
Also, how do I keep my hash in order? Tie::IxHash ? Thank you for the help. -honyok

In reply to Re^6: clunky Tk GUI by honyok
in thread clunky Tk GUI by honyok

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.