Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

change_managed(4) [hpux man page]

change_managed()														  change_managed()

Name
  change_managed     -	   Composite	 class	   method     to     respond	 to	a     change	 in	a     list     of     managed
  widgets.

Synopsis
  typedef void (*XtWidgetProc)(Widget);
	 Widget w;

Inputs
  w	    Specifies the widget that has had children managed or unmanaged.

Description
  The change_managed() method is registered on the change_managed field of the Composite class part structure, and is invoked when a child or
  children are managed or unmanaged with XtManageChild(), XtManageChildren(), XtUnmanageChild(), or XtUnmanageChildren().

  When	a  child  is managed or unmananged, it generally means that the layout of all the children of the widget should be redone.  Note that
  this method does not have an argument which specifies which children have had their managed state changed.   change_managed()  should  loop
  through  all	of the children in its children array, using XtIsManaged() to determine which are managed and should therefore be included in
  the layout calculations.

  The change_managed() method is not chained.  A widget class that does not define a change_managed() method can inherit this method from its
  superclass by specifying XtInheritChangeManaged in its Composite change_managed() class field.

Usage
  Many	change_managed()  methods  simply  call a general layout routine which may also be called from other places in the widget such as the
  resize() method.

Example
  The following procedure is the change_managed() method for the Xaw Form widget.  Note how it loops through all  of  its  children,  setting
  constraint  fields for those that are managed, and then calls a layout routine (which is a class method of the Form widget in this case) to
  recalculate the layout of all children.  It makes no attempt to determine which children have been managed or unmanaged.

     static void ChangeManaged(w)
	 Widget w;
     {
       FormWidget fw = (FormWidget)w;
       FormConstraints form;
       WidgetList children, childP;
       int num_children = fw->composite.num_children;
       Widget child;

       /*
	* Reset virtual width and height for all children.
	*/

       for (children = childP = fw->composite.children ;
	    childP - children < num_children; childP++) {
	 child = *childP;
	 if (XtIsManaged(child)) {
	   form = (FormConstraints)child->core.constraints;

     /*
      * If the size is one (1) then we must not change the virtual sizes, as
      * they contain useful information.  If someone actually wants a widget
      * of width or height one (1) in a form widget he will lose, can't win
      * them all.
      *
      * Chris D. Peterson 2/9/89.
      */

	   if ( child->core.width != 1)
	     form->form.virtual_width = (int) child->core.width;
	   if ( child->core.height != 1)
	     form->form.virtual_height = (int) child->core.height;
	 }
       }
       (*((FormWidgetClass)w->core.widget_class)->form_class.layout)
					      ((FormWidget) w, w->core.width,
					       w->core.height, TRUE);
     }

See Also
  Composite(3), Constraint(3).

Xt - Intrinsics Methods 													  change_managed()

Check Out this Related Man Page

XtUnmanageChildren()													      XtUnmanageChildren()

Name
  XtUnmanageChildren - remove a list of children from a parent widget's managed list.

Synopsis
  void XtUnmanageChildren(children, num_children)
	 WidgetList children;
	 Cardinal num_children;

Inputs
  children   Specifies an array of child widgets.  Each child must be of class RectObj or any subclass thereof.

  num_children
	     Specifies the number of elements in children.

Description
  XtUnmanageChildren()	unmaps	the  specified	widgets and removes them from their parent's geometry management.  The widgets will disappear
  from the screen, and (depending on its parent) may no longer have screen space allocated for them.

  Each of the widgets in the children array must have the same parent.

  See the "Algorithm" section below for full details of the widget unmanagement procedure.

Usage
  Unmanaging widgets is the usual method for temporarily making them invisible.  They can be re-managed with XtManageChildren().

  You can unmap a widget, but leave it under geometry management by calling XtUnmapWidget().  You  can	destroy  a  widget's  window  without
  destroying the widget by calling XtUnrealizeWidget().  You can destroy a widget completely with XtDestroyWidget().

  If  you  are	only going to unmanage a single widget, it is more convenient to call XtUnmanageChild().  It is often more convenient to call
  XtUnmanageChild() several times than it is to declare and initialize an array of widgets to pass to XtUnmanageChildren().  Calling XtUnman-
  ageChildren() is more efficient, however, because it only calls the parent's change_managed() method once.

Algorithm
  XtUnmanageChildren() performs the following:

  o  Issues an error if the children do not all have the same parent or if the parent is not a subclass of compositeWidgetClass.

  o  Returns immediately if the common parent is being destroyed; otherwise, for each unique child on the list, XtUnmanageChildren() performs
     the following:

     -	Ignores the child if it already is unmanaged or is being destroyed.

     -	Otherwise, if the child is realized, it makes it nonvisible by unmapping it.

  o  Calls the change_managed() method of the widgets' parent if the parent is realized.

Structures
  The WidgetList type is simply an array of widgets:

     typedef Widget *WidgetList;

See Also
  XtDestroyWidget(1), XtIsManaged(1), XtManageChild(1), XtManageChildren(1), XtUnmanageChild(1).

Xt - Geometry Management												      XtUnmanageChildren()
Man Page