Different objects have different properties

Richmond Mathewson richmondmathewson at gmail.com
Sun Oct 4 16:38:57 EDT 2009


Yeah, I know; stating the crashingly obvious.

BUT; I don't see why this should be necessary, if Graphic Objects
can have a Label (even though, by default, this possibility is hidden
from us) why can they not have icons?

Presumably the answer, like so many answers, is that somebody
made a reasonably random decision, not thinking that somebody
might, one day, wish to assign an icon to a Graphic object.

Trying to work round this one I found that one also cannot assign
imageData to a graphic object:

put the imageData of img ID 1007 into grc "gXXX"

NOR can one do this sort of thing:

put img "m.png" into grc "gXXX"

what is faintly misleading is that the ScriptEditor in RR 4 dp-4
doesn't find anything wrong with these lines of code.

The best way round this problem seems to be something
like this:

set the pattern of  grc "gXXX" to 1007

where 1007 is an imageID.

The only snag is that your Graphic Object shouldn't be
much larger than the image you are using as an icon
unless you want it tiled as a repeating pattern.

----------------------------------------------------------------------------

Why not do away with hard-and-fast defined object types
and have a generic OBJECT which could have its TYPE
defined just as all its other properties? This would make
things considerably more flexible.



More information about the use-livecode mailing list