in reply to Re: Tk-Canvas Grouping
in thread Tk-Canvas Grouping
The problem I'm having is that once grouped I can't seem to click or mouse over the child rectangles. I'm able to identify the id's by using:sub drag_group { my ($c) = @_; my $e = $c->XEvent; # get the screen position of the move... my ( $sx, $sy ) = ( $e->x, $e->y,,, ); print "\t screen: $sx, $sy\n"; # get the canvas position... my ( $cx, $cy ) = ( $c->canvasx($sx), $c->canvasy($sy) ); print "\t canvas: $cx, $cy\n"; # get the amount to move... my ( $dx, $dy ) = ( $cx - $draginfo{lastx}, $cy - $draginfo{lasty} + ); print "\t dx, dy = $dx, $dy\n"; # move it... $c->move( $draginfo{id}, $dx, $dy ); }
sub items_retrieve { my $id = shift; my @items = @{$group{$id}{items}}; return @items; }
|
|---|