The LiteClue Widget
Copyright 1995 Computer Generation, Inc. You
may reproduce this document without charge provided
this copyright notice appears. The software described
in this document is copyrighted under separate terms. Please see
the source code.
The software is provided "as is", without warranty of any kind, express
or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement.
In no event shall Computer Generation, inc. nor the author be liable for
any claim, damages or other liability, whether in an action of contract,
tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.
The author welcomes comments and suggestions. LiteClue is a widget
which pops a one line help
message when the user passes the pointer over another "watched" widget. This is
known by various names in the industry such as hints, clues, tips
and balloon help.
Clues are particularly helpful for push buttons that contain graphic
pixmaps rather than text. They obviate the need to place text within graphics
in the button which creates internationalization problems.
A clue may be attached to virtually any widget that has a window (no gadgets).
LiteClue does not require Motif
None of this affects the behaviour of the watched widget itself.
LiteClue monitors enter and leave events of the watched widget's
window passively.
LiteClue inherits behaviour and ewsources from OverrideShell.
The class pointer is xcgLiteClueWidgetClass.
The class name is xcgLiteClue.
The source distribution kit contains the following files:
LiteClue has been compiled successfully on NCR MPRAS,
Digital OSF/Unix, and Linux.
To build the test program:
LiteClue adds the following resources to those it inherits. The resource class
is obtained by replacing the N by a C in the resource name (eg:
XtNfont is the name XtNfont is the class. The access types are
C (resource may be set at create time), S (may be se using XtSetValues), or
G (may be read using XtGetValues).
The background color resource XtNbackground of the clue popup is
inherited from OverrideShell.
LiteClue adds no new callbacks over those it inherite.
LiteClue has no translations.
LiteClue contains the following functions that control the widget behaviour.
The LiteClue widget is designed to allow the display of internationalized
text. This has been tested on a limited basis with Japanese.
In order to make use of internationalization, you must have support
in your operating system for the desired locale and must have the
needed fonts. In some cases, you may use the X provided locale
support instead. At initialization, you should have code that
looks something like:
If you need the X locale package, add the following:
Finally, you must set the environment symbol LANG to the appropriate locale.
For Japanese, one possibility is "LANG=ja_JP.eucJP".
1. Copyright
Gary Aviv
Computer Generation, Inc.,
gary@compgen.com
404-705-28112. Introduction
3. Distribution Kit
xmkmf
make
4. Resources
The font used to display the clue.
The color used to render the clue text
5. Callbacks
6. Translations
7. LiteClue API
7.1 XcgLiteClueAddWidget -- Add a widget to be watched.
7.2 XcgLiteClueDeleteWidget -- Delete a widget that is watched.
7.3 XcgLiteClueSetSensitive - Enable/disable clues for watched widget.
False - make insensitivity
7.4 XcgLiteClueGetSensitive - Get sensitivity setting for watched widget.
False - watched widget is not sensitive
7.5 Internationalization
if (setlocale(LC_ALL,"") == NULL)
fprintf(stderr, "LiteCluetest: Can't set locale\n");
if (!XSupportsLocale())
{
fprintf(stderr, "LiteCluetest: X does not support locale\n");
setlocale(LC_ALL,NULL) ;
}
if (XSetLocaleModifiers("") == NULL)
fprintf(stderr, "LiteCluetest: Can't XSetLocaleModifiers\n");
#define X_LOCALE
#include <X11/Xlocale.h>
LiteClue makes use of the XR5 Font Set technology. All
font resources are converted to Font Sets. For example, for Japanese
you will need three fonts for each font set:
*normalFont: \
-sony-fixed-medium-r-normal--0-110-100-100-c-0-jisx0201.1976-0,\
-adobe-new century schoolbook-medium-r-normal-*-14-*,\
-jis-fixed-medium-r-normal--16-110-100-100-c-160-jisx0208.1983-0
*h1Font: \
-sony-fixed-medium-r-normal--0-170-100-100-c-0-jisx0201.1976-0,\
-adobe-new century schoolbook-bold-r-normal-*-24-*,\
-jis-fixed-medium-r-normal--24-170-100-100-c-240-jisx0208.1983-0
! etc for each font resource