destroy man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

destroy()							     destroy()

Name
  destroy - Object class method called when a widget is destroyed.

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

Inputs
  w	    Specifies the widget that is being destroyed.

Description
  The  destroy() method is registered on the destroy field of the Object,
  RectObj, or Core class part structures.  It is invoked by XtDestroyWid‐
  get()	 as  part of the destruction process when any widget or object is
  destroyed, and should deallocate any	memory	or  resources  associated
  with	the part of the widget instance structure specific to this class.
  It does not free the widget instance structure itself.

  The destroy() methods of a widget class and all  its	superclasses  are
  called in subclass-to-superclass order.  (Note that this is the reverse
  of the usual superclass-to-subclass chaining sequence.)  The	destroy()
  method  of  a	 widget class should deallocate memory or other resources
  that were explicitly allocated by this class.	 Any  resource	that  was
  obtained  from  the resource database or passed in an argument list was
  not created by the widget and therefore should not be destroyed  by  it
  (unless  the	widget	allocated  memory  to copy the resource value, in
  which case the memory must be freed).

  To reclaim memory, at least the following deallocations should be  per‐
  formed:

  ·  Call  XtFree()  on dynamic storage allocated with XtCalloc(), XtMal‐
     loc(), etc.

  ·  Call XFreePixmap() on pixmaps created with direct Xlib calls.

  ·  Call XtReleaseGC() on GCs allocated with XtGetGC().

  ·  Call XFreeGC() on GCs allocated with direct Xlib calls.

  ·  Call XtRemoveEventHandler() on event handlers added with  XtAddEven‐
     tHandler().

  ·  Call XtRemoveTimeOut() on timers created with XtAppAddTimeOut().

  ·  Call XtDestroyWidget() for each child if the widget has children and
     is not a subclass of compositeWidgetClass.

  The destroy() method is chained, so it cannot be inherited.  If a  wid‐
  get  does  not need to deallocate any storage, the destroy field in its
  widget class record should be NULL.

  See XtDestroyWidget(1) for details on the process  of	 widget	 destruc‐
  tion.

Usage
  In  general, a destroy() method will deallocate any resources allocated
  in the initialize() and set_values() methods.	 This often includes GCs,
  pixmaps, and any copies that were made of string resources.

Example
  The  following  procedure is the destroy() method of the Xaw Label wid‐
  get.	It frees the copy it made of its label string  resource,  deallo‐
  cates	 two  shared  GCs,  and	 frees the stipple pixmap it used to draw
  itself in insensitive mode.

     static void Destroy(w)
	 Widget w;
     {
	 LabelWidget lw = (LabelWidget)w;

	 XtFree( lw->label.label );
	 XtReleaseGC( w, lw->label.normal_GC );
	 XtReleaseGC( w, lw->label.gray_GC);
	 XmuReleaseStippledPixmap( XtScreen(w), lw->label.stipple );
     }

See Also
  XtDestroyWidget(1),
  Core(3),
  Constraint destroy(4), initialize(4), set_values(4).

Xt - Intrinsics Methods						     destroy()
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net