home *** CD-ROM | disk | FTP | other *** search
- /*
- * help.c -- xrobots v1.0
- */
-
- #include <X11/Intrinsic.h>
- #include <X11/StringDefs.h>
- #include <X11/Shell.h>
- #include <X11/AsciiText.h>
- #include <X11/Command.h>
- #include <X11/Box.h>
- #include "help.h"
-
- /*----------------------------------------------------------------------*/
-
- Widget help_popup;
-
- static Arg arglist_text[] = {
- { XtNheight, (XtArgVal) 300 },
- { XtNtextOptions, (XtArgVal) scrollVertical },
- { XtNwidth, (XtArgVal) 505 },
- { XtNstring, (XtArgVal) "\
- xrobots -- version 1.0\n\
- \n\
- Welcome to the world of xrobots. Where the bad guys (the robots) are \n\
- incredibly stupid and the good guy (the smiley face) is outnumbered.\n\
- You (as the good guy) can avoid death and achieve instant fame and \n\
- gratification by appropriate use of the mouse and/or keyboard.\n\
- \n\
- The mouse: \n\
- Clicking the left mouse button moves the smiley face one step in the \n\
- direction of the pointer. Clicking directly on top of the smiley face \n\
- takes a turn, but does not change it's position. \n\
- \n\
- Clicking the middle mouse button causes the smiley face to run like heck. \n\
- Of course, the robots can run just as fast so it really doesn't matter... \n\
- Or does it? \n\
- \n\
- Clicking the right mouse button gives the smiley a rest. This is the \n\
- same as clicking on the 'wait' button.\n\
- \n\
- \n\
- The keyboard: \n\
- 's' triggers the sonic screwdriver. \n\
- 't' triggers the teleportation device. \n\
- 'w' waits until robots are breathing down your neck. \n\
- '.' waits one turn. \n\
- \n\
- Directional control:\n\
- \n\
- y k u \n\
- \\|/ \n\
- h- -l \n\
- /|\\ \n\
- b j n \n\
- \n\
- \n\
- Well, that's the low down. If you don't like the mouse or keyboard set up,\n\
- see the manual to find out about changing the translations. \n\
- \n\
- ----\n\
- \n\
- This insomnia killer was written by:\n\
- Brian Warkentine (bwarkent@polyslo.CalPoly.EDU).\n\
- \n\ "
- },
- { XtNeditType, (XtArgVal) XttextRead },
- };
-
-
- static Arg arglist_popdown[] = {
- { XtNresize, (XtArgVal) False },
- { XtNwidth, (XtArgVal) 300 },
- { XtNlabel, (XtArgVal) "Pop Down" },
- { XtNjustify, (XtArgVal) XtJustifyCenter },
- };
-
-
- /*ARGSUSED*/
- static XtCallbackProc
- popdown_callback(w, closure, call_data)
- Widget w;
- caddr_t closure;
- caddr_t call_data;
- {
- XtPopdown(help_popup);
- }
-
-
- void
- create_help_popup(parent)
- Widget parent;
- {
- int i;
- Widget help_box, popdown;
-
- help_popup = XtCreatePopupShell(
- "help_popup",
- transientShellWidgetClass,
- parent, 0,0);
-
- help_box = XtCreateManagedWidget(
- "help_box",
- boxWidgetClass,
- help_popup,
- 0,0);
-
- (void) XtCreateManagedWidget(
- "message",
- asciiStringWidgetClass,
- help_box,
- arglist_text,
- XtNumber(arglist_text));
-
- popdown = XtCreateManagedWidget(
- "popdown",
- commandWidgetClass,
- help_box,
- arglist_popdown,
- XtNumber(arglist_popdown));
- XtAddCallback(popdown,XtNcallback,popdown_callback,0);
- }
-
-
-
- /*ARGSUSED*/
- XtCallbackProc
- show_help_callback(widget,closure,callData)
- Widget widget;
- caddr_t closure;
- caddr_t callData;
- {
- XtPopup(help_popup, XtGrabNone);
- }
-
-
-
-