Image IDs

Peter Haworth pete at lcsql.com
Mon Apr 27 13:56:33 EDT 2015


I'm trying to wrap my head around how LC resolves references to image IDs
when used as button icons or in the imageSource property.

My fist confusion comes from the dictionary entry for the ID property.  It
lists ranges of image IDs that are reserved for specific purposes.  The
range 200,000-299,999 is described as "reserved for application use" What
does that mean exactly?  For example, if I create a new image in a stack,
LC allocates it an id in the 1000 range upwards, not in the 200,000-299,999
range.  Should I be changing the ID to be in the "reserved for application
use" range?

The next confusion comes from the dictionary entry for imageSource which
includes what to me is an extremely badly written description of where LC
looks for images and in what order, which to my simple mind is pretty much
incomprehensible :-)

For example, the first place it looks is "1) the stack of the object's
behavior (if applicable)".  Got it.

Next on the list "2) the stack of the owner of the object's behavior".
Isn't that the same as "the stack of the object's behavior"?  An object can
only be in one stack can't it?

After that, there are a series of vertical ellipses ending with "n) the
stack of the object's stack's behavior(if applicable)".  I think that means
that if the behavior is in a substack, this would cause it to look in that
substack's main stack.  But what do they vertical ellipses refer to?

The rest of it is pretty comprehensible, except perhaps for "C) the
object's stack's mainstacks substacks"  Huh?

The description makes no mention of looking in the stacksInUse which I know
for a fact is searched for image IDs since I've successfully placed images
in a library stack and references to them are correctly resolved. Anyone
know when library stacks are searched relative to the other locations
mentioned?

The point of all this is I'm trying to determine if there is a possibility
that an image ID I use may be duplicated in another developer's stack and
the other developer's image used instead of mine.  It seems there is since
the locations searched include any open stacks and any library stacks.

Finally, this area of LC seems really messy to me.  If references to images
were in the same format as behavior references, there would be no need for
this complicated search hierarchy.

Pete


Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>



More information about the use-livecode mailing list