XtAppAddAcB 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]

XtAppAddActions()					     XtAppAddActions()

Name
  XtAppAddActions  -  register	an action table with the Translation Man‐
  ager.

Synopsis
  void XtAppAddActions(app_context, actions, num_actions)
	 XtAppContext app_context;
	 XtActionList actions;
	 Cardinal num_actions;

Inputs
  app_context
	    Specifies the application context.

  actions   Specifies the action table to register.

  num_args  Specifies the number of entries in this action table.

Description
  XtAppAddActions() registers actions, an array of num_actions	XtAction‐
  sRec	structures  with the Translation Manager for the application con‐
  text app_context.  Each element of the array contains	 an  action  name
  and  an  action  procedure  pointer.	 When  a  named action is invoked
  through a translation table, the procedure to be called is looked up in
  the action tables that have been registered.

  If  more  than  one  action  is registered with the same name, the most
  recently registered action is used.  If duplicate actions exist  in  an
  action  table,  the first is used.  XtAppAddActions() registers actions
  globally to an application context.  This is	in  contrast  to  actions
  placed  in  the  Core widget class part actions field which are defined
  locally to a widget class only.

  See XtActionProc(2) for an explanation of how to write an action proce‐
  dure.

Usage
  Note	that  there  is no way to unregister actions.  Registering an new
  definition for an action name will simply make the old definition inac‐
  cessible.

  Action  procedures  should not assume that the widget in which they are
  invoked is realized; an accelerator can cause an action  to  be  called
  for a widget that does not yet have a window.

  You  should never need to call XtAppAddActions() when writing a widget.
  Widget's actions are registered locally to the widget through the  Core
  class part actions field.

Background
  The translation manager provides an interface to specify and manage the
  mapping of X event sequences into procedure calls, for example, calling
  procedure Yes() when the `Y' key is pressed.

  The  translation  manager  uses two kinds of tables to perform transla‐
  tions:

  ·  Action tables, which specify the  mapping	of  externally	available
     procedure name strings to the corresponding procedure.

  ·  A	translation table, which specifies the mapping of event sequences
     to procedure name strings.

  The translation manager uses a simple algorithm to resolve the name  of
  a  procedure specified in a translation table into the actual procedure
  specified in an action table.	 When the widget is realized, the  trans‐
  lation  manager performs a search for the name in the following tables,
  in order:

  ·  The widget's class and all superclass action tables, in subclass-to-
     superclass order.

  ·  The parent's class and all superclass action tables, in subclass-to-
     superclass order, then on up the ancestor tree.

  ·  The action tables registered  with	 XtAppAddActions()  and	 XtAddAc‐
     tions() from the most recently added table to the oldest table.

  As  soon  as it finds a name, the translation manager stops the search.
  If it cannot find a name, the translation manager generates  a  warning
  message.

  The  Intrinsics  reserve  all action names and parameters starting with
  the characters "Xt" for future standard enhancements.	 Users,	 applica‐
  tions,  and  widgets should not declare action names or pass parameters
  starting with these characters  except  to  invoke  specified	 built-in
  Intrinsics functions.

Example
  An  action  table  is	 generally  declared  as a statically initialized
  array.  By convention, the name of an action and the	C  function  name
  are  identical  except  that the function name begins with an uppercase
  letter:

     static XtActionsRec global_actions[] = {
	  {"confirm", Confirm},
	  {"quit", Quit},
     };

  This action table could be registered with the following command:

     XtAppAddActions(app, global_actions, XtNumber(global_action));

Structures
  The XtActionsRec structure and the XtActionList  type	 are  defined  as
  follows:

     typedef struct _XtActionsRec{
	 String	     string;
	 XtActionProc proc;
     } XtActionsRec;

     typedef struct _XtActionsRec *XtActionList;

See Also
  XtActionProc(2).

Xt - Translations and Actions				     XtAppAddActions()
[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