Setting the style of a graphic to line
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 14
- Joined: Fri Jan 02, 2009 6:41 am
Setting the style of a graphic to line
Hello.
Regarding the following handler...
on mouseUp
create graphic "new_line";
set the style of graphic "new_line" to xxxxx;
end mouseUp
...I'm finding that not all of the listed styles for a graphic object will allow compilation.
The following six styles will work: curve, oval, polygon, rectangle, regular and roundRect.
The following style will not compile for me: line.
Does anyone know of a workaround?
Thanks!
---Tom Nally
Regarding the following handler...
on mouseUp
create graphic "new_line";
set the style of graphic "new_line" to xxxxx;
end mouseUp
...I'm finding that not all of the listed styles for a graphic object will allow compilation.
The following six styles will work: curve, oval, polygon, rectangle, regular and roundRect.
The following style will not compile for me: line.
Does anyone know of a workaround?
Thanks!
---Tom Nally
Re: Setting the style of a graphic to line
Set the properties of the graphic you wish to create before issuing the 'create' command...
Code: Select all
set the style of the templateGraphic to rectangle
-
- Posts: 14
- Joined: Fri Jan 02, 2009 6:41 am
Re: Setting the style of a graphic to line
Thanks, Dixie.
The following line...
set the style of the templateGraphic to line;
...produces a compilation error.
The lines shown below produce no compilation errors:
set the style of the templateGraphic to oval;
set the style of the templateGraphic to curve;
set the style of the templateGraphic to rectangle;
set the style of the templateGraphic to roundRect;
set the style of the templateGraphic to regular;
set the style of the templateGraphic to polygon;
Thanks!
---Tom Nally
The following line...
set the style of the templateGraphic to line;
...produces a compilation error.
The lines shown below produce no compilation errors:
set the style of the templateGraphic to oval;
set the style of the templateGraphic to curve;
set the style of the templateGraphic to rectangle;
set the style of the templateGraphic to roundRect;
set the style of the templateGraphic to regular;
set the style of the templateGraphic to polygon;
Thanks!
---Tom Nally
Re: Setting the style of a graphic to line
try :-
putting 'line' in quotes...
Code: Select all
set the style of the templateGraphic to "line"

-
- Posts: 14
- Joined: Fri Jan 02, 2009 6:41 am
Re: Setting the style of a graphic to line
Thanks, Dixie.
That definitely works. The code compiles without error, and the object is created.
Even though I can't see the object, I know it is there because its "handles" show up in edit mode.
I'm mystified as to why it's not showing up.
I'm setting the lineSize to 5; I'm setting the visible to true; I'm setting the penColor to "red". I'm setting the borderColor to "red".
Objects other than lines will show up with no problems. I'm only having trouble with the line object.
I'll keep experimenting.
Thanks again.
---Tom Nally
That definitely works. The code compiles without error, and the object is created.
Even though I can't see the object, I know it is there because its "handles" show up in edit mode.
I'm mystified as to why it's not showing up.
I'm setting the lineSize to 5; I'm setting the visible to true; I'm setting the penColor to "red". I'm setting the borderColor to "red".
Objects other than lines will show up with no problems. I'm only having trouble with the line object.
I'll keep experimenting.
Thanks again.
---Tom Nally
Re: Setting the style of a graphic to line
Hi Tom...
The graphic is there...
but now you need to give your line graphic a line to show...
The graphic is there...

Code: Select all
on mouseUp
set the style of the templateGraphic to "line"
set the points of the templateGraphic to 20,20 & cr & 50,50
create grc "boo"
end mouseUp
-
- Posts: 14
- Joined: Fri Jan 02, 2009 6:41 am
Re: Setting the style of a graphic to line
Dixie: thank you very much. That was very helpful!
---Tom Nally
---Tom Nally