home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************
- Copyright 1990 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
- Permission to use, copy, modify, and distribute these examples for any
- purpose and without fee is hereby granted, provided that the above
- copyright notice appear in all copies and that both that copyright
- notice and this permission notice appear in supporting documentation,
- and that the name of Digital not be used in advertising or publicity
- pertaining to distribution of the software without specific, written
- prior permission.
-
- DIGITAL AND THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT
- OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
- OR PERFORMANCE OF THIS SOFTWARE.
-
- ******************************************************************/
-
- #include <X11/Intrinsic.h> /* Standard include files */
- #include <X11/StringDefs.h>
- #include "Box.h" /* Widget include files */
- #include "Label.h"
- #include "Pushbutton.h"
-
- void Goodbye(widget, clientData, callData) /* Callback procedure */
- Widget widget;
- XtPointer clientData, callData;
- {
- exit(0);
- }
-
- Arg labelArgs[] = { /* The arguments to the label widget */
- {XtNx, 10},
- {XtNy, 10},
- {XtNlabel, "Goodbye, world"}};
-
- Arg buttonArgs[] = { /* The arguments to the button widget */
- {XtNx, 10},
- {XtNy, 40},
- {XtNlabel, "Click and die"}};
-
- int main(argc, argv)
- unsigned int argc;
- char **argv;
- {
- Widget toplevel, label, button, box;
- XtAppContext app;
-
- toplevel = XtAppInitialize(&app, "Goodbye",
- (XrmOptionDescList) NULL, 0, &argc, argv,
- (String *) NULL, (ArgList) NULL, 0);
-
- box = XtCreateManagedWidget("box", boxWidgetClass,
- toplevel, (Arg *) NULL, 0);
-
- label = XtCreateManagedWidget("label", labelWidgetClass,
- box, labelArgs, XtNumber(labelArgs));
-
- button = XtCreateManagedWidget("button", pushbuttonWidgetClass,
- box, buttonArgs, XtNumber(buttonArgs));
- XtAddCallback(button, XtNcallback, Goodbye, NULL);
-
- XtRealizeWidget(toplevel);
- XtAppMainLoop(app);
- }
-