use Win32::GUI(); use constant { TME_HOVER => 1, TME_LEAVE => 2, 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 ], -notify=>1, -onMouseOver => sub { $label->Change(-background => [255,0,0],-text=>'', ); return 0; }, -onMouseOut => sub { $label->Change(-background => [0,0,255],-text=>'', ); $state=0; return 0;}, -onMouseMove => \&Move, ); $mw->Show(); Win32::GUI::Dialog(); sub Move { return unless $state == 0; $state = 1; $label->TrackMouse(100,TME_HOVER|TME_LEAVE); return 1; }