Rectangle Object Class


Overview

The Rectangle object class allows the application to draw a rectangular object. It is also used as a base class for other object classes that are drawn in rectangular form such as a Text object. The coordinates of the rectangle are specified in a data structure of type XintRectangle. Graphic attributes such as the line color, line width, fill style and fill color are set using resources defined in the Graphic class.

Inherited Behavior and Resources

The Rectangle object class inherits behavior and resources from the Xt Object and Graphic classes.
The following resources are defined by the Rectangle object class:
NameTypeDefaultAccess
XmNrectangleXintRectangle *{10, 10, 25, 25}CSG
XmNrotateAngleint0CSG
XmNroundEdgeBooleanFalseCSG


XmNrectangle

XmNrectangle specifies the coordinates of the rectangle's two opposite points using the data type XintRectangle. This resource is specified as a pointer to a data structure which takes the following form:

   typedef struct {
                   float x1;
                   float y1;
                   float x2;
                   float y2;
   } XintRectangle;

where

MemberDescription
x1,y1Coordinates of the upper left corner of the Rectangle object box.
x2, y2Coordinates of the lower right corner of the Rectangle object box.


XmNrotateAngle

Specifies an angle of rotation in degrees about the center of the rectangle.

XmNroundEdge

Specifies whether the corners of the rectangle are rectangular (False) or rounded (True).

Rectangle Callbacks

The Rectangle object class does not define any new callbacks. However, the callback structure returned with callback XmNverifyCallback (see class Graphic) is redefined. The following ordered table lists the members of the callback structure XintRectangleVerifyCallbackStruct.

Data TypeMemberDescription
intreasonIndicates why the callback was invoked.
XEvent *eventPoints to the XEvent that triggered the callback.
BooleandoitSet to False to cancel the operation.
XintRectangle *dataPointer to the new representation proposed for the Rectangle object.


Rectangle Functions

Function XintCreateRectangle creates a rectangular object.

     Object XintCreateRectangle (...)

WidgetparentParent of new Rectangle object.
char *nameName of new Rectangle object.
ArgListarglistList of resource/value items.
CardinalargcountNumber of items in arglist.


Macros

Macro XintIsRectangle returns True if the specified object is a Rectangle object.

     Boolean XintIsRectangle (Object object)