Next | Prev | Up | Top | Contents | Index
xmDrawingArea and xmDrawnButton
Tm has limited support for the Xlib drawable area or buttons--you can draw only strings on them. This is the only currently defined drawing method for manipulating the xmDrawingArea and xmDrawnButton widgets:
- dw drawImageString gc x y string
-
Use the given graphical context gc to draw the text string starting at position x,y. The 0,0 coordinate is at the upper left of the widget.
The following example produces a familiar "Hello world" widget. It is necessary to use an exposeCallback to get the message redisplayed when needed.
#! /usr/sgitcl/bin/moat
xtAppInitialize
xmDrawingArea .top managed -height 30 -width 150
.top exposeCallback {
set gc [.top getGC -foreground black]
.top drawImageString $gc 10 20 "Hello world"
}
. realizeWidget
. mainLoop
Figure 4-12 : xmDrawingArea
Table 4-47 lists the resources associated with xmDrawingArea.
xmDrawingArea Resources
Resource Name | Default Value | Type or Legal Values |
---|
-marginHeight | 10 | Dimension |
-marginWidth | 10 | Dimension |
-resizePolicy | resize_any | resize_any resize_grow resize_none |
Table 4-48 lists the resources associated with xmDrawnButton.
xmDrawnButton Resources
Resource Name | Default Value | Type or Legal Values |
---|
-multiClick | Inherited from display | multiclick_discard multiclick_keep |
-pushButtonEnabled | False | Boolean |
-shadowType | shadow_out | shadow_in shadow_out shadow_etched_in shadow_etched_out |
Table 4-49 lists the callbacks associated with xmDrawingArea and xmDrawnButton.
Drawing Widget Callbacks
Method Name | Why |
---|
exposeCallback | The area/button should be redrawn. |
inputCallback | A keyboard or mouse event arrived for the area. |
resizeCallback | The area/button is resized. |
activateCallback | The button was activated. |
armCallback | The button is squashed. |
disarmCallback | The button is released. |
Next | Prev | Up | Top | Contents | Index