Replacing group images (was Standalone UI's, data stacks, image files)

Ken Norris pixelbird at interisland.net
Mon Mar 17 15:26:00 EST 2003


**********
> Date: Mon, 17 Mar 2003 08:11:24 -0500
> From: "John J. Theobald" <mailjjt at bellsouth.net>
> Subject: Re: Standalone UI's, data stacks, image files
> 
> You can put an image into an image as long as they are the same geometry
> (their formatted width and height are the same).
----------
Yes, I finally got it to import an image as Iwanted (see script).
---------- 
> As for the background group, that is a little beyond me, as I don't use
> them.  I use groups, but not with background behavior.  If I were doing
> this with an ordinary group, I would just replace the image object in my
> group as above.  I don't see why this would not work with bg behavior
> turned on, but perhaps others have more insight.
----------
Me either, but even without bg bahavior on, I'm still unable to replace
images under script control.

Here's the script:

on mouseUp
  set the defaultFolder to "Doggies"
  answer file empty with filter "JPEGs,*.jpg"
  lock screen
  import paint from file it
  set itemDel to "/"
  put image (last item of it) into image "myImage"
  delete image (last item of it)
  start editing group "myImageGroup"
  create image "myImage" in group "myImageGroup"
  stop editing group
  unlock screen
  send "choose browse tool" to me in 20 milliseconds
end mouseUp

....when it executes, I end up with an empty background group window. When I
select the stack window in the Window menu (which is already checked BTW),
it goes away and I see the image in the stack, but it's not the group, its
the image. The group (myImageGroup) is there, according to the Application
Overview, but there's nothing in it.

Why doesn't the [start editing] command place the image into the group?

TIA,
Ken N.




More information about the use-livecode mailing list