<<<<<<<<<<<<<<<<

xt_wrapper(xt) X Toolkit Intrinsics xt_wrapper(xt)

NAME

xt_wrapper - a generic widget that can be wrapped around an existing window

DESCRIPTION

The xt_wrapper object is a widget (not part of any particular widget library) that allows existing X windows to be placed into the application's widget tree. Normally, when a widget is realized, it creates its own window. This widget, however, takes an existing window id as an instance variable, and during realization, that window id is used as the window for the widget, rather than creating a new window.

SUPERCLASS

xt

INSTANCE VARIABLES

target_window_id the window id used during realization of the widget.

MESSAGES

target_window_id[=?] set/get the target window it

create! Instantiates the widget, sets the "window" resource equal to the target_window_id (the window resource is what is actually used by the realize procedure at realization time) and installs itself into the lymb widget hierarchy.

EXAMPLE

-- -- This script demonstrates how xt_wrapper can be used to take an -- existing xwindow and use it with widgets.

-- open the xdisplay so we can share the same display between motif -- and x classes xdisplay open!;

xshared_cell new: background_color rgb: (.8, .1, .8) ;

! ! mapping xwindow with purple background xwindow new: awin

width= 400

height= 400

background_pixel: [background_color pixel?]

map! ; scalar new:awin_width = [awin actual_width?]; scalar new:awin_height = [awin actual_height?];

-- tell motif about the display motif display= xdisplay application= `xt_wrapper example';

<motifinit

motif_form new: aform

parent= motif

create! ;

motif_label new: alabel

parent= aform

@ "topAttachment" : XmATTACH_FORM

@ "leftAttachment" : XmATTACH_FORM

@ "rightAttachment" : XmATTACH_FORM

@ "labelString" :"The drawing area below is using an xwindow's window"

create! ;

motif_drawing_area new: adrawing_area

parent= aform

@ "topAttachment" : XmATTACH_WIDGET

@ "topWidget" : [alabel id?]

@ "leftAttachment" : XmATTACH_FORM

@ `width' : awin_width

@ `height' : awin_height

create! ;

! ! creating xt_wrapper of the xwindow and remapping ! it as a child of the drawing area in a form widget xt_wrapper new: drawing_area_xt_wrapper parent= adrawing_area target_window_id= [awin id?] create! ;

motif on! start!;

SEE ALSO

related classes


Last Updated On: Fri Mar 10 15:38:51 1995

Please send comments and suggestions to

its-documentation@rpi.edu

Keyword Search of RPInfo Consulting Pages and NewsCache