home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
n
/
newmarch.zip
/
ARROW-AC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-08
|
2KB
|
71 lines
/* Author: $Author: jan $
* File: $Source: /usr/usrs/jan/desktop/X_Book.boo/programs/RCS/arrow-act.c,v $
* Date: $Date: 1992/09/09 00:09:45 $
* Revision: $Revision: 1.1 $
*/
#include "copyright.h"
#include <Xm/Xm.h>
#include <Xm/ArrowB.h>
char Class_name[] ="Arrow";
static char defaultTranslations[] = "<Key>Q: quit()";
static XtTranslations trans_table;
void quit(w, event, params, num_params)
Widget w; /* widget that invoked this function */
XEvent *event; /* last event that triggered the action */
String *params;
int num_params;
{
printf("Key Q was pressed\n");
exit(0);
}
static XtActionsRec actionsTable[] =
{
{"quit", quit} /* name of action and function above */
};
main(argc, argv)
int argc;
char **argv;
{
Widget toplevel, arrow_widget;
/* Initialise the intrinsics with a toplevel widget */
toplevel = XtInitialize(NULL,
Class_name,
NULL,
0,
&argc, argv);
/* Create a widget, with the toplevel as manager;
its class is ArrowButton
*/
arrow_widget = XmCreateArrowButton(toplevel,
"an_arrow",
NULL,
0);
XtManageChild(arrow_widget);
/* register the new actions */
XtAddActions(actionsTable, XtNumber(actionsTable));
/* compile the translation table */
trans_table = XtParseTranslationTable(defaultTranslations);
/* augment the existing translations */
XtAugmentTranslations(arrow_widget, trans_table);
/* display all of the widgets */
XtRealizeWidget(toplevel);
/* enter the main processing loop */
XtMainLoop();
}