How to safely set the icon of a button ?
alex at tweedly.net
Sun Feb 27 18:20:04 EST 2005
J. Landman Gay wrote:
> Even if you use an image's short name as an icon reference, the engine
> will try to resolve that into an image ID number. Under the hood, only
> ID numbers can be assigned as icons. So I'm guessing your image IDs
> duplicate some of those in the Rev IDE. Since it is possible to assign
> an ID to an image (they are the only controls that allow this, and it
> is for this exact reason) just assign a different ID to the images
> that conflict.
Thanks - I did that and it now works - for now (but leaves me a bit
That prompted me to go back and re-read the docs page for "ID" again,
> You can set the ID of an image. Be careful not to set an image ID to a
> number that's the ID of another object in the same stack:
I can (and have) avoided numbers used in my stacks.
> since Revolution uses IDs to keep track of objects, a conflict may
> prevent Revolution from being able to access one or both objects. The
> following ID numbers are reserved and should not be used for image IDs:
> * 1-100: reserved for built-in cursors
> * 101-135: reserved for built-in brush shapes
> * 236-300: reserved for built-in patterns
> * 301-1000: reserved for built-in icons
> * 101,000-103,000: reserved
> * 200,000-299,999: reserved for application use
Images in the Rev IDE should use IDs from the reserved ranges -
- no way to avoid conflicts
- no way to tell if they happen other than viewing every image
- and even that's no guarantee since a later version of Rev IDE
may change which image numbers it uses
- or the stacks may load in a different order and make the
- and no way to guess which ID values are safe.
I'm thinking this should be logged as a bug, and the IDE should stick to
the reserved ranges; what do you think ?
Alex Tweedly http://www.tweedly.net
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.0 - Release Date: 25/02/2005
More information about the Use-livecode