Ovals and Lines
Ovals are created like rectangles. You create an oval by using a place_oval function and you can give its name as a parameter. The oval that is drawn will be the one inscribed in the rectangle. Below is a rectangle created with place_rectangle and an oval created by the same points using place_oval:
Note that instead of changing the fill color, border width, and border color after they were placed, all these were set by parameters in the place_rectangle and place_oval commands.
If you want to make the fill or outline transparent use ‘’ as its value as show below:
You can draw two kinds of lines in GUI4sher, solid lines are created with place_line and dashed lines are created with place_dashed_lines.
Place_line has you click on the two ends of the line to create it:
Lines can have arrows using the set_arrow method.
Since the lower left was the last point clicked on when creating the line, set_arrow(‘last’) put the arrow there. Set arrow takes these possible arguments:
· ‘none’ – no arrows
· ‘first’ – the first point clicked on
· ‘last’ – the last point clicked on
· ‘both’ – both ends of the line
Dashed lines are create with place_dashed_line as shown below:
You can use the set_arrow method or arrow= argument on dashed lines too. You can use set_outline and set_fill methods on lines to change their color. Both methods do the same thing.
The most sophisticated geometric objects you can draw are polygons. You create them with the place_polygon function. Like all geometric objects they have name, width, outline, fill parameters and set_name, set_width, set_outline, and set_fill methods. Creating a polygon requires clicking on all its corners. The first corner is shown as a thick orange dot:
Thereafter, each corner of the polygon you click shows up as a small black dot:
When you have clicked on all the corners of the polygon click on the orange dot to finish:
Contents