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
/
bbdemo.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-08-18
|
1KB
|
35 lines
#include <Xm/BulletinB.h>
#include <Xm/PushB.h>
/***********************************************************************
*** MAIN ***
***********************************************************************/
void main(argc, argv)
unsigned int argc;
char **argv;
{
Widget toplevel, bboard, pbutton[6];
Arg args[10];
XtAppContext app_context;
static char * pbname[] = {"pb1", "pb2", "pb3", "pb4", "pb5", "pb6"};
int i;
/* Initialize the toolkit, create app context, open display,
and create a toplevel shell */
toplevel = XtAppInitialize(&app_context, "Bbdemo", NULL, 0, &argc,
argv, NULL, args, 0);
/* Create the bulletin board widget */
bboard = XmCreateBulletinBoard(toplevel, "bb", args, 0);
XtManageChild(bboard);
/* Create the 6 push button widgets. */
for (i = 0; i < XtNumber(pbname); i++)
pbutton[i] = XmCreatePushButton(bboard, pbname[i], args, 0);
XtManageChildren(pbutton, XtNumber(pbutton));
/* Realize the widgets and loop */
XtRealizeWidget(toplevel);
XtAppMainLoop(app_context);
}