#!/usr/bin/perl -w use strict; use Tk qw/tkinit DoOneEvent exit DONT_WAIT ALL_EVENTS/; use Tk::JComboBox; my $mw = MainWindow->new(); my $combo = $mw->JComboBox( -choices => [ { -name => 'Black', -value => 1 }, { -name => 'Blue', -value => 2 }, { -name => 'Green', -value => 3 }, { -name => 'Purple', -value => 4 }, 'Red', { -name => 'Yellow', -value => 5 } ] )->pack; my $count = 0; my $timer = $mw->repeat(1000,sub{ $count++; }); while ( Tk::Exists($mw) ) { $mw->DoOneEvent( DONT_WAIT | ALL_EVENTS ); print "$count\n"; if( $count > 10 ){ $mw->destroy } } print "end of gui, press a key to continue\n"; <>; print "exiting\n";