From 54270654fc4e4ee572a4b7436d9257e0aa1a129c Mon Sep 17 00:00:00 2001 From: mertz Date: Sun, 12 Feb 2006 09:40:55 +0000 Subject: closing #24 avoiding bug #48 by calling mainloop before any update --- Perl/t/Images.t | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Perl') diff --git a/Perl/t/Images.t b/Perl/t/Images.t index 6dbd88b..058b2c8 100644 --- a/Perl/t/Images.t +++ b/Perl/t/Images.t @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # -# $Id: Images.t,v 1.7 2005-06-27 13:34:02 mertz Exp $ +# $Id: Images.t,v 1.8 2006-02-12 09:40:55 mertz Exp $ # Author: Christophe Mertz # @@ -48,6 +48,16 @@ $zinc = $mw->Zinc(-render => 1, like ($zinc, qr/^Tk::Zinc=HASH/ , "zinc has been created"); +## test cannot be run directly since $zinc->update does not work properly +## when not in a mainloop +## so I use a timer to trigger tests after entering the mainloop + +$zinc->after(10, \&testExecute); + +Tk::MainLoop; + +sub testExecute { + #### creating different images, bitmaps and pixmaps... my $photoMickey = $zinc->Photo('mickey.gif', -file => Tk->findINC("demos/images/mickey.gif")); like ($photoMickey, qr/^Tk::Photo=HASH/ , "creating a Tk::Photo with a .gif"); @@ -212,6 +222,11 @@ $zinc->remove($icon3); # We should also test that changing the content of a Tk::Photo should change the display of an icon +diag("############## Images test"); +exit; + +} + sub wait { $zinc->update; @@ -231,4 +246,3 @@ sub wait { -diag("############## Images test"); -- cgit v1.1