Group disappeared (was More about images)

Ken Norris (dialup) pixelbird at interisland.net
Sun Feb 9 02:37:00 EST 2003


***********
> Date: Fri, 7 Feb 2003 22:54:31 -0800 (PST)
> From: Jan Schenkel <janschenkel at yahoo.com>
> Subject: Re: More about images

> Hi Ken,
> 
> Let's see if I got this right:
> - there's one large image with all the keys in their
> "DOWN" position
> - and you only want to show a small portion of this
> image, at a specific place on the card
----------
That's right.
----------
> If that's correct, the solution I described ought to
> work properly:
> - when you resize a group, this doesn't resize its
> contents but rather, it acts as a window, only showing
> the part of its contents you want to display.
----------
I never would have guessed that. If I understood how and why it works that
would help.
----------
> - you'll have to set its lockLocation to true, or it
> will resize the first chance it gets ; and you'll have
> to set the rect of the group to the size of what you
> want to display.
> - then you can control which part of all that's in the
> group is displayed, by controlling the hScroll and
> vScroll properties of the group.
> - if you need to display it at different positions on
> the card, set the topLeft property of the group ; this
> has no effect on the displayed part of the group.
----------
LockLoc of the group? I guess I'm confused. I thought I had to resize it in
the handler to fit each "key" (button) anyway. The handlers look like this:

on theKey -- in the stack script
  
  -- the image is designed so the "keys" match the button rects
  -- so we can match it up if the original group image is properly set
 
  set the rect of group id 1017 to the rect of the target

  -- Now set the position it displays

  set the hScroll of group id 1017 to the left of the target
  set the vScroll of group id 1017 to the top of the target
end theKey

...the button script looks like this:

on mouseDown
  theKey
  show group id 1017
end mouseDown

on mouseUp
  hide group id 1017
end mouseUp

...I just tried it with one button, and I can see it work OK, but it didn't
quite align like it should have. I tried to show the group from the message
box, but it just showed the little piece. I tried to resize it to the screen
so I could realign the whole image to make it properly match the buttons,
but it went totally HAYWIRE!

The group ended up with only about 1/3 of the BOTTOM RIGHT of original image
in the UPPER LEFT of the screen. The handles were all in the right position,
though, but the bottom right of the screen was transparent, i.e., I could
see the UP group there. When I dragged it down and to the right I could see
that the rest of the UPPER LEFT of the image was missing. The upper left
handle was at the corner, but the rest of the group was cut off.

So I tried to hide the image and see if I could get the button to work, but
I got a squawk box saying it couldn't find the group. I tried to show it
with the msg box but it squawked again, this time saying the group didn't
exist.

So, somehow the group seems to have disappeared from the stack. I don't have
a clue what happened to it.

Any help appreciated.

TIA.
Ken N.





More information about the use-livecode mailing list