Putting images on my user interface stack

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Bruce Underwood
Posts: 8
Joined: Thu Oct 23, 2008 12:10 pm
Location: Victoria, VA, USA
Contact:

Putting images on my user interface stack

Post by Bruce Underwood » Thu Oct 23, 2008 2:39 pm

Background information:
I am using an i-MAC with OS 10.5.5
I am writing a program in which the user enters a calendar date and gets back the day of the week for the date plus an image of the phase of the moon for the entered date.
I have everything working fine up to the point of putting a moon image into a field. The program responds with a phrase such as "October 23 2008 is today, Thursday", and it works for any date from 9000 BC to 4000 AD. It is then supposed to put 1 of 16 images of the moon for that date into a field . The 16 moon images are located on a sub-stack. I can put the image there by using the Inspector, clicking on the folder, then selecting the image from an external folder. But I want to do it within the program, and that's where the problem lies.
I've tried a number of approaches, but always get an error message. It appears that I am not properly specifying the image I want to use.
Hope you can help. Bruce
Bruce Underwood
1457 Nutbush Road
Victoria, VA 23974
bruceu@embarqmail.com
Telephone: (434) 696-5539

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Thu Oct 23, 2008 5:48 pm

Hi Bruce,

this is pretty easy...

1. Create an empty image in your mainstack, where you want to show a specific image.
2. Name it whatever you like. I use the name "moon image" in my example
2. Then add this to your script(s) that will display the correct date and moon phase in your mainstack:

Code: Select all

...
put img "name of your moon image in substack here" of cd X of stack "your substackname here" into img "moon image" of cd Y of "your mainstack name here"
...
Too obvious, isn't it?! :-)


Best

Klaus

Post Reply

Return to “Mac OS”