Contents Up Previous Next

Window

The window is an 'abstract' class which does not exist in its own right, but is used to access the functionality of classes derived from it. Therefore, please refer to this section when considering other classes.

window-add-callback
window-centre
window-close
window-delete
window-enable
window-fit
window-get-name
window-get-next-child
window-get-parent
window-get-x
window-get-y
window-get-width
window-get-height
window-get-client-width
window-get-client-height
window-is-shown
window-make-modal
window-popup-menu
window-refresh
window-remove-callback
window-set-cursor
window-set-focus
window-set-size
window-set-size-hints
window-set-client-size
window-show


window-add-callback

long ( window-add-callback long window-id word event word function)

Sets the callback function of a given window (frame, panel, panel item etc.) for the given event, to be the given CLIPS function. See individual window descriptions for details of valid callbacks.


window-centre

long ( window-centre long window-id word orientation)

orientation may be wxVERTICAL, wxHORIZONTAL or wxBOTH. Centres the window with respect to its parent (or desktop).


window-close

long ( window-close long window-id long force-close)

Closes the dialog or frame without immediately deleting the object. The object will be cleaned up in 'idle' processing time. Use of this function instead of deleting the window directly is highly recommended, especially under Motif which is sensitive to frame and dialog deletion.

This function first calls the window's OnClose handler. If OnClose returns FALSE, the close will be vetoed unless the force-close argument is 1, in which case the deletion will take place anyway.

window-close should only be used for frames and dialog boxes.


window-delete

long ( window-delete long window-id)

Deletes a window. See also window-close.


window-enable

long ( window-enable long window-id long enable)

If enable is 1, enables the window for input. If enable is 0, the window is disabled (greyed out in the case of a panel item).


window-fit

long ( window-fit long window-id)

Fits the panel, dialog box or frame around its children.


window-get-name

string ( window-get-name long window-id)

Gets the window's name (the 'name' parameter passed to a window constructor).


window-get-next-child

long ( window-get-next-child long window-id long child-id)

If child-id is zero, returns the id of the first child window of window-id.

If child-id is a valid child id, returns the id of the next child window.

Returns -1 if there are no more children.

Example:

 (bind ?child-id (window-get-next-child ?win-id 0))
 
 (while (neq ?child-id -1)
   (bind ?type (object-get-type ?child-id))
   ...
   (bind ?child-id (window-get-next-child ?win-d ?child-id))
 )

window-get-parent

long ( window-get-parent long window-id)

Gets the id of the window's parent.


window-get-x

long ( window-get-x long window-id)

Get the x coordinate of the window.


window-get-y

long ( window-get-y long window-id)

Gets the y coordinate of the window.


window-get-width

long ( window-get-width long window-id)

Gets the width of the window.


window-get-height

long ( window-get-height long window-id)

Gets the height of the window.


window-get-client-width

long ( window-get-client-width long window-id)

Gets the client width (space available for child windows) of the window.


window-get-client-height

long ( window-get-client-height long window-id)

Gets the client height (space available for child windows) of the window.


window-is-shown

long ( window-is-shown long window-id)

Returns 1 if the window is shown, 0 otherwise.


window-make-modal

long ( window-make-modal long window-id long modal)

modal may be 1 to disable all frames and dialog boxes except this one, or 0 to enable all frames and dialogs again.

Has no effect in XView.


window-popup-menu

long ( window-popup-menu long window-id long menu-id double x double y)

Pops up a menu on the window, at the given position. The menu will be dismissed (but not destroyed) when the user makes a selection.

Note that there is a reliability problem with Motif popup menus; they may not pop up after the first time.


window-refresh

long ( window-refresh long window-id long erase-background=1 long x=-1 long y=-1 long width=-1 long height=-1 ) Refreshes the give window, causing OnPaint to be called. This function should be called in preference to calling an OnPaint handler directly.

erase-background controls whether the window background is automatically cleared in the current background colour (1) or not (0). The default is 1.

The last four optional arguments define a rectangle to limit the 'damaged' area. If all arguments are -1, this is taken to mean that the whole window should be refreshed.


window-remove-callback

long ( window-remove-callback long window-id word event)

Removes the callback function associated with this event.


window-set-cursor

long ( window-set-cursor long window-id long cursor-id)

Sets the cursor for this window.


window-set-focus

long ( window-set-focus long window-id)

Set this window to have the keyboard focus.


window-set-size

long ( window-set-size long window-id long x long y long width long height)

Sets the position and size of the window.


window-set-size-hints

long ( window-set-size-hints long window-id long min-width=-1 long min-height=-1 long max-width=-1 long max-height=-1 long inc-width=-1 long inc-height=-1) Tells the windowing system to restrict the resizing of the frame or dialog box.

min-width, min-height determine the minimum size of the window.

max-width, max-height determine the maximum size of the window.

inc-width, inc-height determine the increments by which the window is sized (Motif only).

-1 values indicate where default values should be used instead of application-specified values.


window-set-client-size

long ( window-set-client-size long window-id long width long height)

Sets the client size (available space for child windows) of the window.


window-show

long ( window-show long window-id long show)

If show is 1, shows the window. If show is 0, the window is hidden. If the window is a modal dialog box, show = 1 will start the modal loop, and show = 0 will terminate the loop (allowing execution to proceed after the first call to window-show).