aboutsummaryrefslogtreecommitdiff
path: root/Perl
diff options
context:
space:
mode:
authormertz2006-02-12 09:40:55 +0000
committermertz2006-02-12 09:40:55 +0000
commit54270654fc4e4ee572a4b7436d9257e0aa1a129c (patch)
tree942d26ce40d968020085fe14176aa4fb30ce7d95 /Perl
parent5055921ea8aab2d3e0bb642f3f61e52ea812e520 (diff)
downloadtkzinc-54270654fc4e4ee572a4b7436d9257e0aa1a129c.zip
tkzinc-54270654fc4e4ee572a4b7436d9257e0aa1a129c.tar.gz
tkzinc-54270654fc4e4ee572a4b7436d9257e0aa1a129c.tar.bz2
tkzinc-54270654fc4e4ee572a4b7436d9257e0aa1a129c.tar.xz
closing #24
avoiding bug #48 by calling mainloop before any update
Diffstat (limited to 'Perl')
-rw-r--r--Perl/t/Images.t18
1 files changed, 16 insertions, 2 deletions
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");