Class GRect

GObject
  extended by GFillableObject
      extended by GRect

The GRect class is a graphical object whose appearance consists of a rectangular box.


Constructor Summary
GRect(x, y)
Constructs a new rectangle with the specified width and height, positioned at the origin.
GRect(x, y, width, height)
Constructs a new rectangle with the specified bounds.
 
Method Summary
set_bounds(x, y, width, height)
Changes the bounds of this object to the specified values.
set_size(width, height)
Changes the size of this object to the specified width and height.
 
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.
get_fill_color()
Returns the color used to display the filled region of this object.
get_height()
Returns the height of this object, which is defined to be the height of the bounding box.
get_location()
Returns the location of this object as a GPoint.
get_size()
Returns the size of the bounding box for this object.
get_width()
Returns the width of this object, which is defined to be the width of the bounding box.
get_x()
Returns the x-coordinate of the object.
get_y()
Returns the y-coordinate of the object.
is_visible()
Checks to see whether this object is visible.
is_filled()
Returns whether this object is filled.
move(dx, dy)
Moves the object on the screen using the displacements dx and dy.
move_polar(r, theta)
Moves the object using displacements given in polar coordinates.
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_fill_color(color)
Sets the color used to display the filled region of this object.
set_filled(flag)
Sets whether this object is filled.
set_location(x, y)
Sets the location of this object to the point (x, y).
set_visible(flag)
Sets whether this object is visible.
 

Constructor Detail

GRect(x, y)

Constructs a new rectangle with the specified width and height, positioned at the origin.
Usage: grect = GRect(width, height) 
Parameters: 
width  The width of the rectangle in pixels
height  The height of the rectangle in pixels
 


GRect(x, y, width, height)

Constructs a new rectangle with the specified bounds.
Usage: grect = GRect(x, y, width, height) 
Parameters: 
 The x-coordinate of the upper left corner
 The y-coordinate of the upper left corner
width  The width of the rectangle in pixels
height  The height of the rectangle in pixels
 

Method Detail

set_bounds(x, y, width, height)

Changes the bounds of this object to the specified values.
Usage: gobj.set_bounds(x, y, width, height) 
Parameters: 
 The new x-coordinate for the object
 The new y-coordinate for the object
width  The new width of the object
height  The new height of the object
 


set_size(width, height)

Changes the size of this object to the specified width and height.
Usage: gobj.set_size(width, height) 
Parameters: 
width  The new width of the object
height  The new height of the object