Moreover, your code does not use warnings and strict. You are happily using variables in go_page2 that come from the main programme body. Consider a cleaner version of the code:
#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::LabFrame; use Tk::Dialog; use Tk::NoteBook; sub go_page2 { warn "<<@_>>"; my ($nb, $entry_cell) = @_; my $name_topcell = $entry_cell->get; print $name_topcell, "\n"; if ($name_topcell eq q()){ print "yes \n"; my $mssg_empty = $nb->Dialog(-title => 'Fill in Value +s', -text => 'Please fill i +n all the values', -default_button => 'oke', -buttons => [ 'oke'], -bitmap => 'info', )->Show; } else { $nb->pageconfigure('page2', -state => 'normal'); $nb->raise('page2'); } } my $mw = MainWindow->new(-title => 'Main window'); $mw->geometry('1300x800'); my $nb = $mw->NoteBook->pack(-expand => 1, -fill => 'both'); ####### Create page 1 ########## my $entry_cell; # To be sent to go_page2. my $p1 = $nb->add('page1', -label => 'Input / Output'); $p1->Button(-text => 'Next', -width => 15, -height => 2, -command => sub { go_page2($nb, $entry_cell) }, )->place( -x => 1100, -y =>620); my $btBrowse = $p1->Button(-text => 'Browse', -command => \&browse_file, )->place( -x => 450, -y => 105); my $btSave = $p1->Button(-text => 'Browse', -command => \&save_file, )->place( -x => 1180, -y => 105); my $entrybrowse = $p1->Entry(-width => 60)->place( -x => 20, -y => 11 +0); my $entrysave = $p1->Entry(-width => 60)->place( -x => 750, -y => 11 +0); $entry_cell = $p1->Entry(-width => 20)->place( -x => 850, -y => 20 +0); ####### Create page 2 ########## my $p2 = $nb->add('page2', -label => 'page2', -state => 'disabled'); MainLoop();

Note that the user can still fill in the box (which probably should have a label of some sort), activate page 2, return back to page 1, clear the box and return to page 2 by clicking on its tab.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

In reply to Re: Checking state entry widget?! by choroba
in thread Checking state entry widget?! by jerre_111

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.