in reply to Re^3: Drag & Drop Problem
in thread Drag & Drop Problem
Just so I could see what was going on, and not possible loose the things send by the callback. But with this it still seems to be the label I was hoovering over... I wanted the label I was draging! Ofcource, there are other ways. Saveing the one dragged into some global variable... (easier and looks better in the module), but shouldn't passing the scalar to the sub work aswell? I mean, the $label is created in the same sub as that ->DropSite is mentioned. But it's still not the same label everytime, as it should be?my $drop = $hlist->DropSite( -droptypes => [qw(Local)], -dropcommand => sub { perform_drop($label, @_) }, # New! -entercommand => sub { hover_over_drop($label, @_) }, # New!
And you see that the text is changing...sub hover_over_drop { my ($label_obj, $b_entry, $x_pos) = @_; $label_obj->configure(-bg => $b_entry == 1 ? 'gray' : 'lightgray') +; #use Data::Dumper; #print Dumper(@_); if ($b_entry) { #print $label_obj . "\n"; print $label_obj->cget(-text) . "\n"; } }
But, I was hoping for only "Test3".Test3 Test3 Test2 Test1 Test2 Test3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Drag & Drop Problem
by liverpole (Monsignor) on May 23, 2006 at 11:51 UTC |