PhabLoad

PhabLoad — reads, creates, names and realizes a widget hierarchy.

Syntax

PhabLoad (filename, realize?)

		

Arguments

filename

The name of the widget file to load.

realize

t or nil. The default (t) realizes the top-level window widget before returning the window hierarchy.

Returns

The top-level window hierarchy on success, otherwise nil.

Description

This is a convenience function that creates and returns a window hierarchy from a filename by calling PhabReadWidgetFile, PhabCreateWidgets, and PhabNameWidgets in succession. And unless realize is set to nil, PhabLoad also calls PtRealizeWidget on the top-level window widget, before returning the window hierarchy.

[Note]

Because the widgets created by this function are accessed as global variables, it is generally preferred to use the PhabAttachWidgets function.

To use this function, you must load the PhabTemplate.lsp library with a call to require_lisp("PhabTemplate.lsp"). The filename is searched for in the currrent _require_path_ (see PhabReadWidgetFile).

Example

This example, ex_PhabLoad.g, is included in the product distribution.

#!/usr/cogent/bin/phgamma 

/* This example loads and displays a window and all its children.*/

PtInit(nil);
require_lisp("PhabTemplate.lsp");

PhabLoad (string(_os_, "-WidgetFiles/wgt/loadwindow.wgtw"));


PtMainLoop();

See Also

PhabReadWidgetFile, PhabCreateWidgets, PhabNameWidgets, PtRealizeWidget