/* IconT -- test file for Icon widget */

#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <Xfwf/RowCol.h>
#include <Xfwf/Icon.h>

static String fallback_resources[] = {
    "IconT.width: 400",
    "IconT.height: 300",
    "*icon1.image: FATAL",
    "*icon2.image: ERROR",
    "*icon3.image: WARNING",
    "*icon4.image: QUESTION",
    "*icon5.image: INFO",
    "*icon6.image: NONE",
    NULL,
};

static void quit(w, client_data, call_data)
    Widget w;
    XtPointer client_data, call_data;
{
    exit(0);
}

static Widget toplevel, rowcol, icon1, icon2, icon3, icon4,
    icon5, icon6, icon7;
static XtAppContext app_context;

main(argc, argv)
    Cardinal argc;
    String argv[];
{
    toplevel = XtVaAppInitialize
	(&app_context, "IconT", NULL, 0, &argc, argv,
	 fallback_resources, NULL);
    rowcol = XtVaCreateManagedWidget
	("rowcol", xfwfRowColWidgetClass, toplevel, NULL);
    icon1 = XtVaCreateManagedWidget
	("icon1", xfwfIconWidgetClass, rowcol, NULL);
    icon2 = XtVaCreateManagedWidget
	("icon2", xfwfIconWidgetClass, rowcol, NULL);
    icon3 = XtVaCreateManagedWidget
	("icon3", xfwfIconWidgetClass, rowcol, NULL);
    icon4 = XtVaCreateManagedWidget
	("icon4", xfwfIconWidgetClass, rowcol, NULL);
    icon5 = XtVaCreateManagedWidget
	("icon5", xfwfIconWidgetClass, rowcol, NULL);
    icon6 = XtVaCreateManagedWidget
	("icon6", xfwfIconWidgetClass, rowcol, NULL);
    if (argc > 0)
	icon7 = XtVaCreateManagedWidget
	    ("icon7", xfwfIconWidgetClass, rowcol, XtNimage, argv[1], NULL);
    XtAddCallback(icon1, XtNactivate, quit, NULL);
    XtRealizeWidget(toplevel);
    XtAppMainLoop(app_context);
}
