Many thanks for that.
I have tried to use tags as you suggest by adding the same tag to a number of items
that I was going to use as a group.
I then set the following binds where $last_tag_global contained the tag I set on the items.
$wg{Layout_Canvas}->bind($last_tag_global, '<1>', sub {&mobileStart(); +}); $wg{Layout_Canvas}->bind($last_tag_global, '<B1-Motion>', sub {&mobile +Move();}); $wg{Layout_Canvas}->bind($last_tag_global, '<ButtonRelease-1>', sub {& +mobileStop();});
I then used the following subroutines (which I found on another Monks thread) to select the items that had the tag, ‘jump’
them onto the cursor and move them to the required position.
sub mobileStart { my $ev = $wg{Layout_Canvas}->XEvent; ($dx_cursor, $dy_cursor) = (0 - $ev->x, 0 - $ev->y); $wg{Layout_Canvas}->raise('current'); print "START MOVE-> $dx_cursor $dy_cursor\n"; } sub mobileMove { my $ev = $wg{Layout_Canvas}->XEvent; $wg{Layout_Canvas}->move('current', $ev->x + $dx_cursor, $ev->y ++$dy_cursor); ($dx_cursor, $dy_cursor) = (0 - $ev->x, 0 - $ev->y); print "MOVING-> $dx_cursor $dy_cursor\n"; } sub mobileStop{&mobileMove;}
This nearly worked except that it would only move one of the items at a time and only
when the cursor was exactly or nearly exactly over a section (for example a side of a rectangle drawn with canvasRectangle) of the item.
What do I have to do so that I can select all of the items that have a particular tag
(by placing the cursor somewhere in the 'middle' of the items that have the tag)
and move them together to where I want them to be?

In reply to Re^2: Canvas group members syntax by merrymonk
in thread Canvas group members syntax by merrymonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.