in reply to Re: tk image map like button with hover effect
in thread tk image map like button with hover effect
#!/usr/bin/perl use strict; use warnings; use Tk; my($mw,$img1,$img2,$c,$btn,$id); $mw = MainWindow->new; $c = $mw->Canvas(-width => 400,-height =>200,-background=>'black')->pa +ck; $img1=$c->Photo(-file=>'but1.gif'); $img2=$c->Photo(-file=>'but2.gif'); $btn=$c->Button( -command=>sub{exit;}, -image=>$img1)->pack; $id=$c->createWindow(200,150, -window=>$btn); $btn->bind('<Enter>', => sub{ $btn->configure(-image=>$img2);} ); $btn->bind('<Leave>', => sub{ $btn->configure(-image=>$img1);} ); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: tk image map like button with hover effect
by pashanoid (Scribe) on Jul 04, 2011 at 13:39 UTC | |
by Tux (Canon) on Jul 04, 2011 at 14:33 UTC |