#!/usr/bin/perl


    use Tk;
    use Tk::Text;
    use Tk::Scrollbar;

    $mw = MainWindow->new;
    $text;

    $mw->title("Text Entry");

    $mw->Label(
        -text => "Enter some text:"
    )->pack();

    $mw->Entry(
        -textvariable => \$text
    )->pack();

   $mw->Button(
        -text => "Click here",
        -command =>\&update          
    )->pack();
    
    $t = $mw->Scrolled("Text")->pack (-expand=>1, -anchor=>'n');

    MainLoop;
    
    
    sub update
    {
     $ftp_warn = $mw->messageBox(
                -title   => 'Info',
                -message => "Do you wish to continue?",
                -type    => 'YesNo',
           -icon    => 'question',
       );
       
    if ($ftp_warn eq "Yes")
 {
   
   $mw1 = MainWindow->new;
   $mw1->geometry( "200x100" );
   $mw1->title("Client Workspace");
   $mw1->Label(
           -text => "Enter the Perforce client name:"
       )->pack(-anchor=>'center');
       
   $mw1->Entry(
        -textvariable => \$text_clnt
    )->pack(-anchor=>'center');
  $f_ok = $mw1->Button(
            -text => "OK",
            -command =>
                 sub 
                 {
                 $t->insert("end","You entered: $text_clnt \n");
                 
                 }
  )->pack(-anchor=>'center');
  }   
  
}


    