Setting graphic style to Line

miscdas at boxfrog.com miscdas at boxfrog.com
Fri Feb 7 06:36:01 EST 2003


Jan Schenkel writes: 

> --- Jim Witte <jswitte at bloomington.in.us> wrote:
>>    These observations refer to both 1.1.1 and 2.0 I
>> think (I haven't 
>> done rigorous testing).  When I try to set the style
>> of a graphic 
>> object to line (eg. set style of the selectedObject
>> to line') I get an 
>> error (Expression: missing factor). 
>> 
>>    But if I create one line, then set the style of
>> another object to the 
>> style of the first line, it disappears.  The object
>> is still listed in 
>> the application overview (at least in 20a), but it
>> won't show on the 
>> screen (If I set the style to something other than a
>> line, it shows up; 
>> then if I select line again, it disappears. 
>> 
>> I tried the script mentioned before on the list: 
>> 
>> set the style of the defaultgraphic to line
>> create graphic linetohost
>> set the points of graphic linetohost to MyVertList
>> choose browse tool 
>> 
>> but got a " missing '(' " error on the 'set the
>> style..' line. 
>> 
>> Thanks,
>> Jim 
>> 
> 
> Hi Jim, 
> 
> Try the following :
>   set the style of graphic "Foobar" to "line" 
> 
> As 'line' is a reserved word in Transcript, it's
> better to surround it with quotes to avoid any
> misinterpretation by the compiler. 
> 
> In this case, the compiler thinks you want to set the
> style of the graphic to the _content_ of line XXX of a
> variable or another container, and reports an error as
> itthinks you forgot the rest of the reference. 
> 
> Hope this helped, 
> 
> Jan Schenkel.
=========
The disappearing graphic when style is set to line appears to be a "feature" 
built into the MC engine. On MC 2.4.3, Win XP pro, I tried setting the style 
to "line" of a variety of graphic objects and indeed some of them disappear. 
They display if the style property is set to another value, such as regular. 
The same behavior occurs if a graphic object line is drawn, and then the 
script 

set the style of myGraphic to the style of thelineGraphic 

So, you'll have to evaluate this usage on an object-by-object basis to 
determine if you can use it for your particular app. 

miscdas 




More information about the use-livecode mailing list