MrmFetchWidget(3Xm)

NAME
MrmFetchWidget - Fetches and then creates any indexed (uil named) application widgets and its children.

SYNOPSIS
#include <Xm/Intrinsics>
#include <Mrm/MrmPublic.h>
Cardinal MrmFetchWidget(hierarchy_id, index, parent_widget, widget, class)
MrmHierarchy hierarchy_id;
String index;
Widget parent_widget;
Widget *widget;
MrmType *class;

DESCRIPTION
The MrmFetchWidget function fetches and then creates an indexed application widget and its children. The indexed application widget is any widget that is named in uil and that is not the child of any other widget in the uid hierarchy. In fetch operations, the fetched widget's subtree is also fetched and created. This widget must not appear as the child of a widget within its own subtree. MrmFetchWidget does not execute XtManageChild for the newly created widget.

hierarchy_id
    Specifies the ID of the uid hierarchy that contains the interface definition. The hierarchy_id was returned in a previous call to MrmOpenHierarchy.

index
    Specifies the uil name of the widget to fetch.

parent_widget
    Specifies the parent widget ID.

widget
    Returns the widget ID of the created widget. If this is not NULL when you call MrmFetchWidgetOverride, MRM assumes that the widget has already been created and MrmFetchWidgetOverride returns MrmFAILURE.

class
    Returns the class code identifying MRM's widget class. The widget class code for the main window widget, for example, is MRMwcMainWindow. Literals identifying MRM widget class codes are defined in Mrm.h.

MrmFetchWidget fetches widgets where MrmFetchInterfaceModule is not used. MrmFetchWidget provides specific control over which widgets are fetched from a uil file; MrmFetchInterfaceModule, on the other hand, fetches all widgets in a single call. An application can fetch any named widget in the uid hierarchy using MrmFetchWidget. MrmFetchWidget can be called at any time to fetch a widget that was not fetched at application startup. MrmFetchWidget determines if a widget has already been fetched by checking widget for a NULL value. Non-NULL values signify that the widget already has been fetched, and MrmFetchWidget fails. MrmFetchWidget can be used to defer fetching pop-up widgets until they are first referenced (presumably in a callback), and then used to fetch them once.

MrmFetchWidget can also create multiple instances of a widget (and its subtree). In this case, the uid definition functions as a template; a widget definition can be fetched any number of times. An application can use this to make multiple instances of a widget, for example, in a dialog box box or menu.

The index (uil name) that identifies the widget must be known to the application.

RETURN VALUE
This function returns one of these status return constants:

MrmSUCCESS
    The function executed successfully.

MrmNOT_FOUND
    Widget not found in UID hierarchy.

MrmFAILURE
    The function failed.

RELATED INFORMATION
MrmFetchWidgetOverride(3Xm)