Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xtorderproc(3) [hpux man page]

XtOrderProc()															     XtOrderProc()

Name
  XtOrderProc - interface definition for an XtNinsertPosition procedure.

Synopsis
  typedef Cardinal (*XtOrderProc)(Widget);
	 Widget w;

Inputs
  w	    Specifies the widget.

Description
  An XtOrderProc is registered as the value of the XtNinsertPosition resource of a composite widget, and is called by some subclasses of Com-
  posite to determine the position in the Composite children array at which a newly created child should be inserted.

  An XtOrderProc should return the position in the array at which w should be inserted.  A return value of zero means that it should  be  the
  first  widget  in the array, a return value of one means that there should be one widget before it in the array, and so on.  A return value
  equal to the XtNnumChildren resource indicates that the widget should be placed at the end of  the  array,  which  is  the  default  if  no
  XtOrderProc is registered.

Usage
  Note that for many composite widgets, the position of a child in the children array has nothing to do with its position on the screen.  The
  XtNinsertPosition resource will only be interesting if the widget does not provide any other method of positioning its children.

  The Composite class insert_child() method calls the XtOrderProc, if any, registered on the XtNinsertPosition resource.  Most composite sub-
  classes inherit or call this procedure explicitly and will therefore do the same.

  Note	that  the XtNinsertPosition procedure is not a method of the widget class.  It could be considered an "instance method" rather than a
  "class method."  In this way it is similar to the procedure that can be registered on the XtNcreatePopupChildProc resource of a shell  wid-
  get.

Example
  None	of  the  standard  MIT	clients make use of the XtNinsertPosition resource.  An example of where an XtOrderProc might be useful is an
  application that dynamically creates a number of button widgets (to represent mail folders or newsgroups, perhaps) and  places  them	in  a
  simple  Xaw  Box  widget.  Since these buttons will differ from user to user, and can be inserted and deleted during a session, it would be
  logical to place them in alphabetical order.	An XtOrderProc could do this by using XtGetValues() to get the current list of	widget	chil-
  dren, and then comparing the name (using XtName()) of the specified widget against the names of all the existing widgets.

See Also
  Composite(3),
  delete_child(4), insert_child(4).

Xt - Geometry Management													     XtOrderProc()

Check Out this Related Man Page

Composite(library call) 												   Composite(library call)

NAME
Composite -- The Composite widget class SYNOPSIS
#include <Xm/Xm.h> DESCRIPTION
Composite widgets are intended to be containers for other widgets and can have an arbitrary number of children. Their responsibilities (implemented either directly by the widget class or indirectly by Intrinsics functions) include: o Overall management of children from creation to destruction. o Destruction of descendants when the composite widget is destroyed. o Physical arrangement (geometry management) of a displayable subset of managed children. o Mapping and unmapping of a subset of the managed children. Instances of composite widgets need to specify the order in which their children are kept. For example, an application may want a set of command buttons in some logical order grouped by function, and it may want buttons that represent filenames to be kept in alphabetical order. Classes Composite inherits behavior and resources from Core. The class pointer is compositeWidgetClass. The class name is Composite. New Resources The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource val- ues for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A). +-----------------------------------------------------------------------+ | | Composite Resource Set | | | |Name | Class | Type | Default | Access | +------------------+-------------------+-------------+---------+--------+ |XmNchildren | XmCReadOnly | WidgetList | NULL | G | +------------------+-------------------+-------------+---------+--------+ |XmNinsertPosition | XmCInsertPosition | XtOrderProc | NULL | CSG | +------------------+-------------------+-------------+---------+--------+ |XmNnumChildren | XmCReadOnly | Cardinal | 0 | G | +------------------+-------------------+-------------+---------+--------+ +------------------+-------------------+-------------+---------+--------+ XmNchildren A read-only list of the children of the widget. XmNinsertPosition Points to the XtOrderProc function described below. XmNnumChildren A read-only resource specifying the length of the list of children in XmNchildren. The following procedure pointer in a composite widget instance is of type XtOrderProc: Cardinal (* XtOrderProc) (Widget w); w Specifies the widget. Composite widgets that allow clients to order their children (usually homogeneous boxes) can call their widget instance's XmNinsertPosition procedure from the class's insert_child procedure to determine where a new child should go in its children array. Thus, a client of a com- posite class can apply different sorting criteria to widget instances of the class, passing in a different XmNinsertPosition procedure when it creates each composite widget instance. The return value of the XmNinsertPosition procedure indicates how many children should go before the widget. A value of 0 (zero) indicates that the widget should go before all other children; returning the value of XmNumChildren indicates that it should go after all other chil- dren. By default, unless a subclass or an application provides an XmNinsertPosition procedure, each child is inserted at the end of the XmNchildren list. The XmNinsertPosition procedure can be overridden by a specific composite widget's resource list or by the argument list provided when the composite widget is created. Inherited Resources Composite inherits behavior and resources from the superclass described in the following table. For a complete description of each resource, refer to the reference page for that superclass. +---------------------------------------------------------------------------------------------------------------+ | | Core Resource Set | | | |Name | Class | Type | Default | Access | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNaccelerators | XmCAccelerators | XtAccelerators | dynamic | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNancestorSensitive | XmCSensitive | Boolean | dynamic | G | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNbackground | XmCBackground | Pixel | dynamic | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNbackgroundPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNborderColor | XmCBorderColor | Pixel | XtDefaultForeground | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNborderPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNborderWidth | XmCBorderWidth | Dimension | 1 | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNcolormap | XmCColormap | Colormap | dynamic | CG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNdepth | XmCDepth | int | dynamic | CG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNdestroyCallback | XmCCallback | XtCallbackList | NULL | C | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNheight | XmCHeight | Dimension | dynamic | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNinitialResourcesPersistent | XmCInitialResourcesPersistent | Boolean | True | C | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNmappedWhenManaged | XmCMappedWhenManaged | Boolean | True | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNscreen | XmCScreen | Screen * | dynamic | CG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNsensitive | XmCSensitive | Boolean | True | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNtranslations | XmCTranslations | XtTranslations | dynamic | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNwidth | XmCWidth | Dimension | dynamic | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNx | XmCPosition | Position | 0 | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ |XmNy | XmCPosition | Position | 0 | CSG | +------------------------------+-------------------------------+----------------+----------------------+--------+ +------------------------------+-------------------------------+----------------+----------------------+--------+ Translations There are no translations for Composite. RELATED
Core(3). Composite(library call)
Man Page