which means that you can specify normal resource−value pairs or the quadruplet used by XtVaTypedArg. We use
the latter form to specify resource values that are not in the appropriate type, so that the toolkit handles the type
conversion. For a discussion on type conversion and the use of XtVaTypedArg, see Volume Four, X Toolkit
Intrinsics Programming Manual.
14.5 Scale Tick Marks
The Motif Style Guide suggests that a Scale widget can have "tick marks" that represent the incremental positions of
the Scale. The Scale widget does not provide these marks by default, but you can add them yourself by creating
Labels as children of a Scale widget, as demonstrated in the source code Each of the Label gadgets are given the same
name (a dash), which is used as the actual label since the XmNlabelString resource is not set. Obviously, in a
more complex application, the Labels should specify information that helps the user to read the Scale.
XtSetLanguageProc() is only available in X11R5; there is no corresponding function in X11R4.
/* tick_marks.c −− demonstrate a scale widget with tick marks. */
#include <Xm/Scale.h>
#include <Xm/LabelG.h>
#define MAX_VAL 10 /* arbitrary value */
main(argc, argv)
int argc;
char *argv[];
{
Widget toplevel, scale;
XtAppContext app;
int i;
XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaAppInitialize (&app, "Demos", NULL, 0,
&argc, argv, NULL, NULL);
scale = XtVaCreateManagedWidget ("load",
xmScaleWidgetClass, toplevel,
XtVaTypedArg, XmNtitleString, XmRString, ...