parent is the name of the xwindow object for the parent window. If this is not set, the default root window of the display will be used as the parent.
visual is the name of the associated visual. If you specify a visual, you must do it before the window is created.
If you set the visual, you will also need to set a few of the window's attributes using the xset_window_attributes. First, you will need to set the colormap attribute to a suitable colormap for the visual type. Next, you will need to supply a border_pixmap of the correct depth or a border_pixel. Again, these should be set before you create the window with the new visual or you will get a BadMatch error.
x is the window's x position within its parent.
xset_window_attributes is the name of the xset_window_attributes object that is associated with this window.
y is the window's y position within its parent.
actual_y? returns the window's y position within its parent. If you are using a window manager that reparents windows, the value returned may be the window's position within the window manager frame.
actual_width? returns the window's width.
actual_height? returns the window's height.
background_pixel: pixel sets the background color of the window. This is the implementation of a convenience function, thus this attribute is not saved. If you need to save this value, use the xset_window_attributes to set the background.
background_pixmap: pixmap sets the background pixmap of the window. The argument pixmap is the name of an xpixmap object. This is the implementation of a convenience function, thus this attribute is not saved. If you need to save this value, use the xset_window_attributes to set the background.
border_pixel: pixel sets the border color of the window. This is the implementation of a convenience function, thus this attribute is not saved. If you need to save this value, use the xset_window_attributes to set the border.
border_pixmap: pixmap sets the border pixmap of the window. The argument pixmap is the name of an xpixmap object. This is the implementation of a convenience function, thus this attribute is not saved. If you need to save this value, use the xset_window_attributes to set the border.
border_width= value sets the border_width instance variable.
border_width? returns the value of the border_width instance variable on the argument stack.
change_window_attributes! updates the window attributes according to the values in the xset_window_attributes structure.
clear! clears the window.
clear: x y width height clears the rectangular area of the window that is specified by x, y, width and height.
colormap: colormap sets the colormap of the window. The argument colormap is the name of an xcolomap object. This is the implementation of a convenience function, thus
this attribute is not saved. If you need to save this value, use the xset_window_attributes to set the colormap.
Note: if you are also changing the visual type of the window, set the colormap using the xset_window_attributes instead.
create! creates the window and sets the instance variable id.
cursor: xcursor sets the cursor of the window. The argument, xcursor, is the name of an xcursor object.
destroy! destroys the X window, but not the xwindow object.
free! frees the xwindow object.
id= X_window_pointer sets the id of the window. Usually this is set when the window is created, but you may want to set it. For example, if you wanted to use the default root window, you could get the id from the display. Or, if you are using a widget, and you want to do "low level" X, you can get the window id from the widget. This method has the side effect of also setting the width, height, depth, x and y.
lower! lowers the window in the stacking order.
map! maps the window.
map_raised! raises the window to the top of the stacking order and maps it.
map_state? returns the map state. Possible values are 0 (unmapped), 1 (unviewable) and 2 (viewable).
move! moves the window to the position specified by the x and y instance variables.
move_resize! moves the window to the position specified by the x and y instance variables and resizes the window according to the width and height instance variables.
parent= parent_object_name sets the parent instance variable.
parent? returns the value of the parent instance variable on the argument stack.
raise! raises the window to the top of the stacking order.
reparent: parent_xwindow reparents the window where parent_xwindow is the name of an xwindow object.
resize! resizes the window according to the width and height instance variables.
store_name:name sets the window title in the window's frame to the argument string.
undefine_cursor! undefines the current cursor in the window. The parent's cursor will then be inherited.
unmap! unmaps the window.
visual= visual_object_name sets the visual instance variable.
visual? returns the value of the visual instance variable on the argument stack.
x= x sets the x instance variable.
x? returns the value of the x instance variable on the argument stack.
x+ value adds value to x.
xset_window_attributes= xset_window_attributes_object_name sets the xset_window_attributes instance variable.
xset_window_attributes? returns the value of the xset_window_attributes instance variable on the argument stack.
y= y sets the y instance variable.
y+ value adds value to y.
xwindow new: the_window width= 100 height= 300 map! x= 200 y= 100 move!;
/* example #2 */ /* * This is an example of how to create a window with a * different visual type than the default. * * To see a listing of the available visuals for your * display, you might want to use the "xdpyinfo" command * if it is available on your system. */
/* create the visual */
xdirect_color_visual new: `myvis' depth= 24 match! print: colormap_size ;
/* create a colormap using the visual */
xcolormap new: `mycmap' visual= myvis create! ;
/* allocate a pixel in the colormap */ xshared_cell new: `xsc' colormap= mycmap rgb:(1.0,0.9,0.50) print: pixel ;
/* * create a window using the visual. * * when creating a window with a new visual type, you must * remember to set the colormap and border (border_pixel or * border_pixmap) attributes to appropriate values for the * visual type. */ xset_window_attributes new: att colormap= mycmap border_pixel= [xsc pixel?] ;
xwindow new: xwin
border_width= 0 visual= myvis depth= 24 xset_window_attributes= att ;
xwin create!;
xwin map!;
xdisplay flush!;
Please send comments and suggestions to
its-documentation@rpi.edu