ZJ.Mike.2009 has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Monks, I'm trying to modify a code snippet that has MouseOver event on a main window object to work on a label object but somehow it simply doesn't work. Can someone kindly give me some guidance on what I might be doing wrong? Thanks in advance.
use Win32::GUI(); sub TME_HOVER() {1} sub TME_LEAVE() {2} sub HOVER_DEFAULT() {0xFFFFFFFF} $state = 0; $mw = Win32::GUI::Window->new( -title => 'Test', -pos => [170,100], -size => [200,220], ); $label = $mw->AddLabel( -background => [0,0,255], -pos => [ 70, 60 ], -size => [50, 50 ], -onMouseOver => sub { $label->Change(-background => [255,0,0], ); return 0; }, -onMouseOut => sub { $label->Change(-background => [255,0,0], ); $state=0; return 0;}, -onMouseMove => \&Move, ); $mw->Show(); Win32::GUI::Dialog(); exit(0); sub Move { return unless $state == 0; $state = 1; $label->TrackMouse(500,TME_HOVER|TME_LEAVE); return 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I get OnMouseOver event to work on a label?
by zentara (Cardinal) on Jan 30, 2010 at 15:17 UTC | |
by ZJ.Mike.2009 (Scribe) on Jan 31, 2010 at 02:23 UTC | |
by Anonymous Monk on Jan 31, 2010 at 02:04 UTC | |
|
Re: How do I get OnMouseOver event to work on a label?
by AnomalousMonk (Archbishop) on Jan 30, 2010 at 19:09 UTC |