Haven't solved the resizeing problem yet, so if you feel up to it, you can check that out.
With the reference I meant that I was expecting the reference to $label created in the addCol to be send... but seems to be the one hovering over instead...
I changed to:
my $drop = $hlist->DropSite(
-droptypes => [qw(Local)],
-dropcommand => sub { perform_drop($label, @_) }, # New!
-entercommand => sub { hover_over_drop($label, @_) }, # New!
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?
So, basicly, how can I pass the reference to the label I'm DRAGING? :)
Try this:
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";
}
}
And you see that the text is changing...
For instance, draging column #3 prints:
Test3
Test3
Test2
Test1
Test2
Test3
But, I was hoping for only "Test3".
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.