#!/usr/bin/perl
use warnings;
use strict;
use Tk qw/tkinit DoOneEvent exit DONT_WAIT ALL_EVENTS/;
my $mw = tkinit;
$mw->Button(
-text => 'Test',
-command => sub { print "Pushed\n" },
)->pack();
$mw->Button(
-text => 'Quit',
-command => sub { Tk::exit(0) },
)->pack();
my $I;
while (1) {
$mw->DoOneEvent( DONT_WAIT | ALL_EVENTS );
if ( ++$I > 10000 ) { #slows things down use 1 for max speed
print '.';
$I = 0;
}
}
####
sub manual_loop_control {
$mw1->DoOneEvent( DONT_WAIT | ALL_EVENTS );
$mw2->DoOneEvent( DONT_WAIT | ALL_EVENTS );
$mw3->DoOneEvent( DONT_WAIT | ALL_EVENTS );
}
####
$mw->repeat(10, \&manual_loop_control);