in reply to Re^5: A question on using Tk::ItemStyle in Tk::Tree
in thread A question on using Tk::ItemStyle in Tk::Tree
I was waiting and hoping if choroba would also respond. Anyway, this kind of detailed response from you does help for newbie like me. I had to repeatedly read through your response and hence it took me sometime to go through the after call details you specified.
in this particular scenario can be replaced by:$mw->after( 'idle', [configure => $styleref_select_parent, -background => 'cyan' ], );
So how do these fit in to permit the syntax 2000=> configure => $treeafter(*ms*, *callback*?).
was replaced bysub brscmd { my ($previous_index, $actual_index) = @_; my ($row, $col) = split ',', $actual_index; my ($sel, $js); $sel = $t->curselection(); # <-- THE PROBLEM print "@$sel\n"; foreach $js (@$sel) { print "\n[brscmd] actual index <$actual_index> from curselection <$js>\n"; } }
and things just happen to work fine.sub brscmd { my ($previous_index, $actual_index) = @_; my ($row, $col) = split ',', $actual_index; my ($sel, $js); $t->after( 'idle', # <-- THE SOLUTION sub{ my $sel = $t->curselection(); print "@$sel\n"; foreach $js (@$sel) { print "[brscmd] actual index <$actual_index> from curselection <$js> last_button_key <$last_button_key>\n"; } } ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: A question on using Tk::ItemStyle in Tk::Tree
by Loops (Curate) on Nov 05, 2014 at 20:31 UTC |