/* OptButtonT -- test program for OptionButton widget */

#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <Xfwf/Board.h>
/* #include <Xm/BulletinB.h> */
#include <Xfwf/OptButton.h>

static String fallback_resources[] = {
    "OptButtonT.width: 400",
    "OptButtonT.height: 200",
    "*button.x: 10",
    "*button.y: 10",
    "*button.label: <none>",			/* Initial label */
    "*button.options:\
first-choice\\n\
second-choice\\n\
third-choice\\n\
Quit",
    NULL,
};

static Widget toplevel, board, button;
static XtAppContext app_context;

static void do_something(w, client_data, call_data)
    Widget w;
    XtPointer client_data, call_data;
{
    String item = (String) call_data;

    if (strcmp(item, "Quit") == 0)
	exit(0);
    else
	(void) printf("callback: do something with \"%s\"\n", item);
}


int main(argc, argv)
    Cardinal argc;
    String *argv;
{
    toplevel = XtVaAppInitialize
	(&app_context, "OptButtonT", NULL, 0, &argc, argv,
	 fallback_resources, NULL);
    board = XtVaCreateManagedWidget
	("board", xfwfBoardWidgetClass, toplevel, NULL);
    button = XtVaCreateManagedWidget
	("button", xfwfOptionButtonWidgetClass, board, NULL);
    XtAddCallback(button, XtNcallback, do_something, NULL);
    XtRealizeWidget(toplevel);
    XtAppMainLoop(app_context);
}
