Loading ...
Sorry, an error occurred while loading the content.

TK question

Expand Messages
  • Jadi
    Dear TKers, I have a question about TK. My code produces 2 labels and 2 entry fields. I m trying to write a program which sets the second entry to boy if and
    Message 1 of 1 , Oct 3, 2003
    • 0 Attachment
      Dear TKers,



      I have a question about TK. My code produces 2 labels and 2 entry fields.

      I'm trying to write a program which sets the second entry to "boy" if and

      only if the user type 'Jadi' in the first one.



      It must be something like this:


      $codevar='boy' if ($iname->get eq 'Jadi');


      But where should I write it?



      p.s. I'm using active perl on damned WinXP

      ******** here is my original code **********
      use Tk;
      require Tk::Dialog;

      use Win32::OLE qw(in with);
      use Win32::OLE::Const 'Microsoft Excel';

      $Win32::OLE::Warn = 3; # die on errors...

      my $top = new MainWindow;
      $top->configure(-title=>"Title");

      my $lname = $top->Label(-textvariable=>\'Name');
      my $iname= $top->Entry();
      $iname->grid(-row=>0, -col=>1);
      $lname->grid(-row=>0, -col=>0);

      my $lcode = $top->Label(-textvariable=>\'code :');
      my $icode = $top->Entry(-textvariable=>\$codevar);
      $icode->grid(-row=>1, -col=>1);
      $lcode->grid(-row=>1, -col=>0);

      MainLoop;



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.