Application Header file Class Header file Class Class Name Superclass |
<X11/XawPlus/DrawingArea.h> <X11/XawPlus/DrawingAreaP.h> drawingAreaWidgetClass drawingArea Simple |
The DrawingArea widget adds a backing store machanism to the Simple widget, so it becomes usable as a drawing area. With this backing store DrawingArea is able to handle resize and redisplay events without any action from your application. A set of drawing functions is provided which are equivalent to the Xlib drawing functions, except that these functions work on a DrawingArea widget.
It is possible to use DrawingArea directly, using the drawing functions with their procedural interface. It is also possible (and a good idea) to use this widget as superclass of an application specific drawing widget.
This widget is new in XawPlus and not available with the Xaw widget set.
When creating a DrawingArea widget instance, the following resources are retrieved from the argument list of XtSetValues() or XtVaSetValues() or from the resource database:
Name | Class | Type | Default Value |
OBJECT: | |||
destroyCallback | Callback | Pointer | NULL |
RECTANGLE: | |||
borderWidth height sensitive width x y |
BorderWidth Height Sensitive Width Position Position |
Dimension Dimension Boolean Dimension Position Position |
0 12 True 12 0 0 |
CORE: | |||
border background mappedWhenManaged |
BorderColor Background MappedWhenManaged |
Pixel Pixel Boolean |
XtDefaultForeground grey75 True |
ADD3DEXT: | |||
highlightColor shadowColor buttonBorderWidth |
Background Background Width |
Pixel Pixel Dimension |
grey90 grey40 2 |
SIMPLE: | |||
cursor cursorName pointerColor pointerColorBackground insensitiveBorder |
Cursor Cursor Foreground Background Insensitive |
Cursor String Pixel Pixel Pixmap |
None NULL XtDefaultForeground XtDefaultBackground NULL |
DrawingArea adds no new resources to the resource list.
DrawingArea comes with a set of drawing functions. These functions are known from the Xlib. The difference is, that these function work directly on a DrawingArea widget including support of the backing store. That is the reason why you never should try to use the Xlib functions on a DrawingArea widget.
This is not a complete description of the drawing functions. To learn more about these functions take a look to the Xlib reference. To find the equivalent function, replace Xaw with X in the function name.
Function Name | Arguments | Description |
XawClearWindow | w | Drawing area widget |
Use this function to clear the drawing area.
Function Name | Arguments | Description |
XawDrawPoint | w gc x, y |
Drawing area widget graphics context coordinates of the point |
Use this function to draw a point using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawDrawPoints | w gc points[] npoints mode |
Drawing area widget graphics context list of point coordinates number of points drawing mode: Relative to origin or previous point |
Use this function to draw a set of points using the given gc in the drawing area.
Function Name | Arguments | Description |
XawDrawLine | w gc x1, y1 x2, y2 |
Drawing area widget graphics context starting point end point |
Use this function to draw a line using the given gc in the drawing area.
Function Name | Arguments | Description |
XawDrawLines | w gc points[] npoints mode |
Drawing area widget graphics context list of point coordinates number of points drawing mode: Relative to origin or previous point |
Use this function to draw connected lines using the given gc in the drawing area.
Function Name | Arguments | Description |
XawDrawSegments | w gc segments[] nsegments |
Drawing area widget graphics context list of line coordinates number of segments |
Use this function to draw unconnected lines using the given gc in the drawing area.
Function Name | Arguments | Description |
XawDrawRectangle | w gc x, y width, height |
Drawing area widget graphics context upper left edge of the rectangle widht and height of the rectangle |
Use this function to draw a rectangle using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawDrawRectangles | w gc rectangles n |
Drawing area widget graphics context list of rectangle coordinates number of rectangles |
Use this function to draw a set of rectangles using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawDrawArc | w gc x, y width, height angle1, angle2 |
Drawing area widget graphics context center position of the circle/elipsoid widht and height of the circle/elipsoid draw from angle 1 to angle 2 |
Use this function to draw a circle, an elpsoid or a part of it using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawDrawArcs | w gc arcs n |
Drawing area widget graphics context parameters of the circles/elipsoids number of circles |
Use this function to draw a set of circles using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawFillRectangle | w gc x, y width, height |
Drawing area widget graphics context upper left edge of the rectangle widht and height of the rectangle |
Use this function to draw a filled rectangle using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawFillRectangles | w gc rectangles n |
Drawing area widget graphics context list of rectangle coordinates number of rectangles |
Use this function to draw a set of filled rectangles using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawFillArc | w gc x, y width, height angle1, angle2 |
Drawing area widget graphics context center position of the circle/elipsoid widht and height of the circle/elipsoid draw from angle 1 to angle 2 |
Use this function to draw a filled circle, a filled elpsoid or a part of it using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawFillArcs | w gc arcs n |
Drawing area widget graphics context parameters of the circles/elipsoids number of circles |
Use this function to draw a set of filled circles using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawFillPolygon | w gc points[] npoints shape mode |
Drawing area widget graphics context list of point coordinates number of points drawing mode complex, convex or nonconvex relative or absolute coordinates |
Use this function to draw a filled polygon using the given gc in the drawing area.
Function Name | Arguments | Description |
XawDrawString | w gc x, y str n |
Drawing area widget graphics context position of the string in the widget the text string number of characters |
Use this function to draw a string on a transparent background using the given graphics context gc in the drawing area.
Function Name | Arguments | Description |
XawDrawImageString | w gc x, y str n |
Drawing area widget graphics context position of the string in the widget the text string number of characters |
Use this function to draw a string with filling the background using the given graphics context gc in the drawing area.