Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xtsetlanguageproc(3) [hpux man page]

XtSetLanguageProc()													       XtSetLanguageProc()

Name
  XtSetLanguageProc - register the language procedure called to set the locale.

Synopsis
  XtLanguageProc XtSetLanguageProc(app_context, proc, client_data)
	   XtAppContext app_context;
	   XtLanguageProc proc;
	   XtPointer client_data;

Inputs
  app_context
	    Specifies the application context in which the language procedure is to be used, or NULL.

  proc	    Specifies the language procedure.

  client_data
	    Specifies additional data to be passed to the language procedure when it is called.

Returns
  The previously registered language procedure.

Availability
  Release 5 and later.

Description
  XtSetLanguageProc() registers proc as the language procedure that will be called (with client_data) from XtDisplayInitialize() for all sub-
  sequent displays initialized in the application context app_context.	The language procedure is called by XtDisplayInitialize() (in Release
  5) in order to determine the language string and perform whatever localization is required by an internationalized application.

  If  app_context is NULL, the specified language procedure is registered in all application contexts created by the calling process, includ-
  ing any future application contexts that may be created.  If proc is NULL a default language procedure is registered.

  XtSetLanguageProc() returns the previously registered language procedure.  If a language procedure has not yet been registered, the  return
  value is unspecified but if it is used in a subsequent call to XtSetLanguageProc(), it will cause the default language procedure to be reg-
  istered.

  Note that the "default" language procedure is not registered by default; you must call XtSetLanguageProc() with a proc of NULL to  register
  this default procedure.  If XtSetLanguageProc() is never called, XtDisplayInitialize() determines the language string by the same procedure
  it used prior to Release 5.  See XtDisplayInitialize() for more information.

  See the "Background" section below for a description of the default language procedure.  See XtLanguageProc(2) for an explanation of how to
  write a language procedure.

Usage
  Most internationalized applications should call XtSetLanguageProc() directly before calling XtAppInitialize().  The default language proce-
  dure should be adequate for applications that use only the internationalization facilities provided by ANSI-C and Xlib.

Example
  A client wishing to use this default procedure to establish locale can do so as in following example:

	 Widget top;
	 XtSetLanguageProc(NULL, NULL, NULL);
	 top = XtAppInitialize( ... );

Background
  The default language procedure does the following:

  o  Sets the locale according to the environment.  On ANSI C-based systems this is done by calling setlocale(LC_ALL, language).  If an error
     is  encountered  a warning message is issued with XtWarning(), where language is the language string determined by XtDisplayInitialize()
     and passed to the default language procedure.

  o  Calls XSupportsLocale() to verify that the current locale is supported.  If the locale is not supported, a  warning  message  is  issued
     with XtWarning() and the locale is set to "C."

  o  Calls XSetLocaleModifiers() specifying the empty string.

  o  Returns the value of the current locale.  On ANSI-C-based systems this is the return value from a final call to setlocale(LC_ALL, NULL).

See Also
  XtDisplayInitialize(1),
  XtLanguageProc(2).

Xt - Locale Management													       XtSetLanguageProc()

Check Out this Related Man Page

XtSetLanguageProc(3Xt)						   XT FUNCTIONS 					    XtSetLanguageProc(3Xt)

NAME
XtSetLanguageProc - set the language procedure SYNTAX
Widget XtSetLanguageProc(XtAppContext app_context, XtLanguageProc proc, XtPointer client_data); ARGUMENTS
app_context Specifies the application context in which the language procedure is to be used, or NULL. proc Specifies the language procedure, or NULL. client_data Specifes addional client data to be passed to the language procedure when it is called. DESCRIPTION
XtSetLanguageProc sets the language procedure that will be called from XtDisplayInitialize for all subsequent Displays initialized in the specified application context. If app_context is NULL, the specified language procedure is registered in all application contexts created by the calling process, including any future application contexts that may be created. If proc is NULL a default language procedure is reg- istered. XtSetLanguageProc returns the previously registered language procedure. If a language procedure has not yet been registered, the return value is unspecified but if this return value is used in a subsequent call to XtSetLanguageProc, it will cause the default language procedure to be registered. The default language procedure does the following: o Sets the locale according to the environment. On ANSI C-based systems this is done by calling setlocale( LC_ALL, language ). If an error is encountered a warning message is issued with XtWarning. o Calls XSupportsLocale to verify that the current locale is supported. If the locale is not supported, a warning message is issued with XtWarning and the locale is set to ``C''. o Calls XSetLocaleModifiers specifying the empty string. o Returns the value of the current locale. On ANSI C-based systems this is the return value from a final call to setlocale( LC_ALL, NULL ). A client wishing to use this mechanism to establish locale can do so by calling XtSetLanguageProc prior to XtDisplayInitialize. SEE ALSO
X Toolkit Intrinsics - C Language Interface Xlib - C Language X Interface XFree86 Version 4.7.0 XtSetLanguageProc(3Xt)
Man Page