PhabLoad

Gamma/Photon: Using Gamma™ with the Photon microGUIŽ, Version 4.0
Prev |  | Next

# `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.

| 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 `gamma_ph_`#`_examples_1_QNX4.tgz` file available on the Cogent Web Site.

    #!/usr/cogent/bin/phgamma

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

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

    PhabLoad ("WidgetFiles/wgt/loadwindow.wgtw");

    PtMainLoop();

## See Also

PhabReadWidgetFile, PhabCreateWidgets, PhabNameWidgets, PtRealizeWidget

Prev | Home | Next
`PhabCreateWidgets` | Up | `PhabLookupWidget`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.