Class GLine

GObject
   extended by GLine

The GLine class is a graphical object whose appearance consists of a line segment.


Constructor Summary
GLine(x0, y0, x1, y1)
Constructs a line segment from its endpoints.
 
Method Summary
get_end_point()
Returns the end point of the line as a GPoint object.
get_start_point()
Returns the coordinates of the initial point in the line.
set_end_point(x, y)
Sets the end point of the line to the point (xy).
set_start_point(x, y)
Sets the initial point in the line to (xy), leaving the end point unchanged.
 
Inherited Method Summary
contains(x, y)
Checks to see whether a point is inside the object.
get_bounds()
Returns the bounding box for this object.
get_color()
Returns the color used to display this object.
is_visible()
Checks to see whether this object is visible.
scale(sf)
Scales the object on the screen by the scale factor sf, which applies in both dimensions.
send_backward()
Moves this object one step toward the back in the z dimension.
send_forward()
Moves this object one step toward the front in the z dimension.
send_to_back()
Moves this object to the back of the display in the z dimension.
send_to_front()
Moves this object to the front of the display in the z dimension.
set_color(color)
Sets the color used to display this object.
set_visible(flag)
Sets whether this object is visible.
 

Constructor Detail

GLine(x0, y0, x1, y1)

Constructs a line segment from its endpoints. The point (x0y0) defines the start of the line and the point (x1y1) defines the end.
Usage: gline = GLine(x0, y0, x1, y1) 
Parameters: 
x0  The x-coordinate of the start of the line
y0  The y-coordinate of the start of the line
x1  The x-coordinate of the end of the line
y1  The y-coordinate of the end of the line
 

Method Detail

get_end_point()

Returns the end point of the line as a GPoint object.
Usage: pt = gline.get_end_point() 
Returns: The coordinates of the end point of the line
 


get_start_point()

Returns the coordinates of the initial point in the line. This method is identical to get_location and exists only to provide symmetry with set_start_point.
Usage: pt = gline.get_start_point() 
Returns: The coordinates of the origin of the line
 


set_end_point(x, y)

Sets the end point of the line to the point (xy). The origin of the line remains unchanged.
Usage: gline.set_end_point(x, y) 
Parameters: 
 The new x-coordinate of the end point
 The new y-coordinate of the end point
 


set_start_point(x, y)

Sets the initial point in the line to (xy), leaving the end point unchanged. This method is therefore different from set_location, which moves both components of the line segment.
Usage: gline.set_start_point(x, y) 
Parameters: 
 The new x-coordinate of the origin
 The new y-coordinate of the origin