Icons and scope
Jan Schenkel
janschenkel at yahoo.com
Wed Sep 10 13:51:02 EDT 2003
--- Graham Samuel <livfoss at blueyonder.co.uk> wrote:
> I'm trying to set the icon of a button to an image
> in a different
> substack from the one where the button is. I note
> from the TD that
> this is possible, but it appears that such an image
> must have a
> unique name. I mean the script has to be like
>
> set the icon of btn "myButton" to "imageForIcon"
>
> The engine then goes and finds "imageForIcon" and
> uses its unique ID
> to set the icon of the button.
>
> It appears you can't write
>
> set the icon of btn "myButton" to image
> "imageForIcon" of cd
> "MyIcons" of stack "myStuff".
>
> So the name of the image has to be unique in the
> whole app. Am I
> right about this, and if so, are there any other
> situations where RR
> breaks the ordinary scope rules, where a name is in
> principle
> qualified by group, card and stack names (some of
> which may in many
> circumstances remain implied)? I have a feeling the
> issue may also
> apply to objects in nested groups, but I'm not sure.
>
> Graham
>
Hi Graham,
When you use the inspector to set a button icon,
you'll see it retains the [unique] ID of the image
that your icon really is. So try :
set the icon of btn "myButton" to the id of \
image "imageForIcon" of cd "MyIcons" of \
stack "myStuff".
Hope this helped,
Jan Schenkel.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
More information about the use-livecode
mailing list