home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
m
/
master12.zip
/
mastering
/
lab00.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-08-19
|
1KB
|
55 lines
#include <Xm/PushB.h>
#include <Xm/BulletinB.h>
/***********************************************************************
*** MAIN ***
***********************************************************************/
void main(argc, argv)
unsigned int argc;
char **argv;
{
Widget toplevel, bboard, pbutton;
Arg args[10];
int n;
char *text = "Push Me";
XmString label_text;
XtAppContext app_context;
/*
* Initialize the toplevel shell widget
*/
toplevel = XtAppInitialize(&app_context, "Lab00", NULL, 0, &argc, argv,
NULL, args,0);
/*
* Create the bulletin board Widget
*/
n = 0;
bboard = XmCreateBulletinBoard (toplevel, "bboard", args, n);
XtManageChild(bboard);
/*
* Create a compound string for the button label
*/
label_text = XmStringCreateLtoR(text, XmFONTLIST_DEFAULT_TAG);
/*
* Create the pushbutton.
*/
n = 0;
XtSetArg(args[n], XmNlabelString, label_text); n++;
pbutton = XmCreatePushButton(bboard, "pbutton", args, n);
XtManageChild(pbutton);
XmStringFree(label_text);
/*
* Realize the toplevel widget, which displays all children
*/
XtRealizeWidget(toplevel);
/*
* Go into a loop and wait for input
*/
XtAppMainLoop(app_context);
}