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

static XtAppContext app_context;
static Widget toplevel, tester, sub1, sub2, sub3;
static String fallback_resources[] = {
    "LabelT.width: 420",
    "LabelT.height: 340",

    "*margin: 5",
    "*borderWidth: 0",
    "*frameWidth: 2",

    "*tester.frameOffset: 6",
    "*tester.width: 300",
    "*tester.height: 300",
    "*tester.cursor: spider",
    "*tester.frameWidth: 2",
    "*tester.frameType: sunken",

    "*sub1.label: \
This program shows multiline labels,\\n\
aligned in various ways,\\n\
inside widgets that grow with the window.\\n\
Unfortunately, there is no Exit button...",
    "*sub1.alignment: bottom",
    "*sub1.location: 20 20 1.0-40 110",
    "*sub1.foreground: red",

    "*sub2.label: at center right",
    "*sub2.alignment: center right",
    "*sub2.location: 5 150 0.5-10 50",
    "*sub2.background: seagreen",
    "*sub2.cursor: heart",

    "*sub3.frameType: chiseled",
    "*sub3.frameWidth: 4",
    "*sub3.label: at\\ntop\\nleft",
    "*sub3.sensitive: False",
    "*sub3.alignment: top left",
    "*sub3.location: 5 210 80 1.0-225",
    "*sub3.foreground: blue",
    "*sub3.cursor: draped_box",

    NULL,
};

void main(argc, argv)
    Cardinal argc;
    char *argv[];
{
    toplevel = XtVaAppInitialize(&app_context, "LabelT", NULL, 0,
				  &argc, argv, fallback_resources, NULL);
    tester = XtVaCreateManagedWidget("tester", xfwfLabelWidgetClass,
				     toplevel, NULL);
    sub1 = XtVaCreateManagedWidget("sub1", xfwfLabelWidgetClass, tester, NULL);
    sub2 = XtVaCreateManagedWidget("sub2", xfwfLabelWidgetClass, tester, NULL);
    sub3 = XtVaCreateManagedWidget("sub3", xfwfLabelWidgetClass, tester, NULL);
    XtRealizeWidget(toplevel);
    XtAppMainLoop(app_context);
}
