Image in pop-up window

Klaus kmajor at metascape.org
Thu Jan 24 03:11:01 EST 2002


Bonjour Aurélien,

> Hello and Bonjour!:)
> 
> Does anybody knows how a mouseUp could open an image in a pop-up window
> (without making a specific card)? My card comes with several clickable
> thumbnails, so the user would clik on one of them in order to see a bigger
> version of the thumbnailed pic (just like in a web page). Is it possible
> with rev?

try this:

create a new stack ("stack "display" in my example) as a substack of
that stack with the clickable thumbnails.

In "display" there should be just one card with an empty image on it.

Now script this in your thumbnail-buttons:

on mouseup
  set the filename of image 1 of stack "display" to \
      "your_path_to/your_imag_here.jpg"
  ###save memory ;-)

  set the rect of stack "display" to the rect of image 1
 ####so the image will fill the entire stack

  palette  "display"   ##or toplevel or whatever
end mouseup

This way there is no need for clonig stacks or stuff.
Just a tiny, reusable extra-stack :-)

You could even give that big image a script...
maybe:

on mouseup
  close this stack
end mouseup

mabe not .-)

Not tested due to lack of time, but you will figure it out...

P.S. A good idea is to store the full path to the big pictures
as a custom-property in the thumbnail-buttons.

I do it all the time.

So you can script (in the group "los thumbos" after grouping
all these buttons):

on mouseup
   if "button" is in the target and the owner of the target is me  then
     set the filename of image 1 of stack "display" to \
         the pathe_exact of the target
   .....
end mouseup

It's just ONE script... (I'm lazy by nature ;-)


Drop a line if you do not know what i am talking about...


Au revoir

Klaus Major <kmajor at metascape.org>
MetaScape GmbH




More information about the use-livecode mailing list