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.
-- 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!;
Please send comments and suggestions to
its-documentation@rpi.edu