###########################zoozdemo.pl########################## #!perl ################## # # This file was automatically generated by ZooZ.pl v1.2 # on Sat May 27 12:43:24 2006. # Project: Project 1 # File: # ################## # # Headers # use strict; use warnings; use Tk 804; # # Global variables # my ( # MainWindow $MW, # Hash of all widgets %ZWIDGETS, ); # # User-defined variables (if any) # my $Label1content = undef; my $check1 = undef; my $check2 = undef; ###################### # # Create the MainWindow # ###################### $MW = MainWindow->new; ###################### # # Load any images and fonts # ###################### ZloadImages(); ZloadFonts (); # Widget Entry1 isa Entry $ZWIDGETS{'Entry1'} = $MW->Entry()->grid( -row => 2, -column => 0, ); # Widget Checkbutton1 isa Checkbutton $ZWIDGETS{'Checkbutton1'} = $MW->Checkbutton( -text => 'Checkbutton1', -variable => \$check1, )->grid( -row => 3, -column => 0, ); # Widget Checkbutton2 isa Checkbutton $ZWIDGETS{'Checkbutton2'} = $MW->Checkbutton( -text => 'Checkbutton2', -variable => \$check2, )->grid( -row => 4, -column => 0, ); # Widget Label2 isa Label $ZWIDGETS{'Label2'} = $MW->Label( -text => 'Label2', -textvariable => \$Label1content, )->grid( -row => 5, -column => 0, ); # Widget Label1 isa Label $ZWIDGETS{'Label1'} = $MW->Label( -text => 'Label1', )->grid( -row => 6, -column => 0, ); # Widget Button1 isa Button $ZWIDGETS{'Button1'} = $MW->Button( -text => 'Update', )->grid( -row => 5, -column => 1, ); # Widget Button2 isa Button $ZWIDGETS{'Button2'} = $MW->Button( -text => 'short loop', )->grid( -row => 6, -column => 1, ); ############### # # MainLoop # ############### MainLoop; ####################### # # Subroutines # ####################### sub ZloadImages { } sub ZloadFonts { } #### # Widget Label1 isa Label $ZWIDGETS{'Label1'} = $MW->Label( -text => 'Label1', -textvariable => \$worker->{labeltext}, )->grid( -row => 5, -column => 0, ); #### # # User-defined variables (if any) # my $worker->{labeltext} = ; #### my %ZWIDGETS; my $worker = ZooZDemo->new(\%ZWIDGETS); #### #!perl ################## # # This file was automatically generated by ZooZ.pl v1.2 # on Sat May 27 13:23:54 2006. # Project: Project 1 # File: # ################## # # Headers # use strict; use warnings; use Tk 804; # # Global variables # my ( # MainWindow $MW, # Hash of all widgets %ZWIDGETS, ); # # User-defined variables (if any) # my $worker->{looptext} = undef; my $worker->{check2} = undef; my $check1 = undef; my $worker->{text} = undef; my $check2 = undef; my $Label1content = undef; my $badger->getlabeltext = ; my $worker->getlabeltext = ; my $worker->{check1} = undef; my $worker->looptext = ; ###################### # # Create the MainWindow # ###################### $MW = MainWindow->new; ###################### # # Load any images and fonts # ###################### ZloadImages(); ZloadFonts (); # Widget Entry1 isa Entry $ZWIDGETS{'Entry1'} = $MW->Entry( -textvariable => \$worker->{text}, )->grid( -row => 2, -column => 0, ); # Widget Checkbutton1 isa Checkbutton $ZWIDGETS{'Checkbutton1'} = $MW->Checkbutton( -text => 'Checkbutton1', -variable => \$worker->{check1}, )->grid( -row => 3, -column => 0, ); # Widget Checkbutton2 isa Checkbutton $ZWIDGETS{'Checkbutton2'} = $MW->Checkbutton( -text => 'Checkbutton2', -variable => \$worker->{check2}, )->grid( -row => 4, -column => 0, ); # Widget Label2 isa Label $ZWIDGETS{'Label2'} = $MW->Label( -text => 'Label2', -textvariable => \$worker->{Label2}, )->grid( -row => 5, -column => 0, ); # Widget Label1 isa Label $ZWIDGETS{'Label1'} = $MW->Label( -text => 'Label1', -textvariable => \$worker->{looptext}, )->grid( -row => 6, -column => 0, ); # Widget Button1 isa Button $ZWIDGETS{'Button1'} = $MW->Button( -command => 'main::_worker__updatelabeltext', -text => 'Update', )->grid( -row => 5, -column => 1, ); # Widget Button2 isa Button $ZWIDGETS{'Button2'} = $MW->Button( -command => 'main::_worker__doshortloop', -text => 'short loop', )->grid( -row => 6, -column => 1, ); ############### # # MainLoop # ############### MainLoop; ####################### # # Subroutines # ####################### sub ZloadImages { } sub ZloadFonts { } sub _worker__doshortloop { } sub _worker__updatelabeltext { } #### #!perl ################## # # This file was automatically generated by ZooZ.pl v1.2 # on Sat May 27 13:23:54 2006. # Project: Project 1 # File: # ################## # # Headers # use strict; use warnings; use Tk 804; # # Global variables # my ( # MainWindow $MW, # Hash of all widgets %ZWIDGETS, ); use ZooZDemo; my $worker = ZooZDemo->new(\%ZWIDGETS); ###################### # # Create the MainWindow # ###################### $MW = MainWindow->new; ###################### # # Load any images and fonts # ###################### ZloadImages(); ZloadFonts (); # Widget Entry1 isa Entry $ZWIDGETS{'Entry1'} = $MW->Entry( -textvariable => \$worker->{text}, )->grid( -row => 2, -column => 0, ); # Widget Checkbutton1 isa Checkbutton $ZWIDGETS{'Checkbutton1'} = $MW->Checkbutton( -text => 'Checkbutton1', -variable => \$worker->{check1}, )->grid( -row => 3, -column => 0, ); # Widget Checkbutton2 isa Checkbutton $ZWIDGETS{'Checkbutton2'} = $MW->Checkbutton( -text => 'Checkbutton2', -variable => \$worker->{check2}, )->grid( -row => 4, -column => 0, ); # Widget Label2 isa Label $ZWIDGETS{'Label2'} = $MW->Label( -text => 'Label2', -textvariable => \$worker->{Label2}, )->grid( -row => 5, -column => 0, ); # Widget Label1 isa Label $ZWIDGETS{'Label1'} = $MW->Label( -text => 'Label1', -textvariable => \$worker->{looptext}, )->grid( -row => 6, -column => 0, ); # Widget Button1 isa Button $ZWIDGETS{'Button1'} = $MW->Button( -command => sub{$worker->updatelabeltext}, -text => 'Update', )->grid( -row => 5, -column => 1, ); # Widget Button2 isa Button $ZWIDGETS{'Button2'} = $MW->Button( -command => sub{$worker->doshortloop}, -text => 'short loop', )->grid( -row => 6, -column => 1, ); ############### # # MainLoop # ############### MainLoop; ####################### # # Subroutines # ####################### sub ZloadImages { } sub ZloadFonts { } #### use strict; use warnings; package ZooZDemo; sub new { my $class = shift; my $tk = shift; my %self = ( tk => $tk, text => '', check1 => 0, check2 => 0, Label1 => '', looptext=> '' ); return bless \%self,$class; } sub doshortloop { my $self = shift; for (1..10) { print "$_"; $self->{looptext} = $_; if ($self->{tk}) { $self->{tk}->{Label1}->update(); } sleep 1; } } sub updatelabeltext { my $self = shift; $self->{Label2} = $self->{text}." - ".$self->{check1}." - ".$self->{check2}; if ($self->{tk}) { $self->{tk}->{Label2}->update(); } } sub getlabeltext { my $self = shift; return $self->{Label2}; } 1;