From e2dab53cba238ea4e292c2b2360ed3188ce843ff Mon Sep 17 00:00:00 2001 From: mertz Date: Mon, 10 Mar 2003 13:34:27 +0000 Subject: when an item change its grpup, it does not move anymore the updateLabel sub works again with the pathtags binding to numeric keys of numeric keypad works fine now --- Perl/demos/Tk/demos/zinc_lib/groups_priority.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Perl/demos/Tk/demos/zinc_lib/groups_priority.pl b/Perl/demos/Tk/demos/zinc_lib/groups_priority.pl index d18e71c..580c3dd 100644 --- a/Perl/demos/Tk/demos/zinc_lib/groups_priority.pl +++ b/Perl/demos/Tk/demos/zinc_lib/groups_priority.pl @@ -118,9 +118,12 @@ $zinc->Tk::bind('' => \&lower); $zinc->Tk::bind('' => \&lower); $zinc->Tk::bind('' => \&toggleItemGroup); +my @KP_MAPPINGS = qw (Insert End Down Next Left Begin Right Home Up Prior); + for my $i (0..9) { $zinc->Tk::bind("" => [\&setPriorrity, $i]); - $zinc->Tk::bind("" => [\&setPriorrity, $i]); + my $code = $KP_MAPPINGS[$i]; + $zinc->Tk::bind("" => [\&setPriorrity, $i]); } # The following binding is currently not possible; only text items @@ -134,7 +137,7 @@ sub updateLabel { my ($group) = @_; my $priority = $zinc->itemcget($group, -priority); # we get the text item from this group: - my $textitem = $zinc->find('withtype', 'text', $group); + my $textitem = $zinc->find('withtype', 'text', ".$group."); $zinc->itemconfigure($textitem, -text => "pri=$priority"); } @@ -202,7 +205,7 @@ sub toggleItemGroup { $newgroup = $group1; } - $zinc->chggroup($item,$newgroup); + $zinc->chggroup($item,$newgroup,1); ## the lats argument is true for mainting $item' position &updateLabel($item); } -- cgit v1.1