/* * Simple application that uses the Xp API. * No XmPrint, no DtPrint, no Print Dialog Manager are used. * * Show an XmFileSelectionBox to figure out how to show e.g. * scrollbars in a sensible way. * * Maybe this should look at $XPSERVERLIST instead of just * using :1 as the printer display. */ static const char rcsid[] = "$Header: /cvsroot/lesstif/lesstif/test/Xm-2.1/print/test3.c,v 1.10 2001/01/19 19:17:45 dannybackx Exp $"; #include #include #include #include #include Display *pdpy; XPContext pctxt; static char *fallback[] = { "*XmPrintShell*fontList: -*-courier-medium-r-normal--*-120-300-300-*-*-iso8859-1", NULL }; int main(int argc, char *argv[]) { XtAppContext appc; Widget top, arrow, print, fsb; XPPrinterList plist; int nlist, i; Screen *pscreen; Window win; Arg al[10]; int ac; top = XtVaAppInitialize(&appc, "drawingArea", NULL, 0, &argc, argv, fallback, NULL); arrow = XtVaCreateManagedWidget("Button1", xmArrowButtonWidgetClass, top, XmNarrowDirection, XmARROW_UP, NULL); XtRealizeWidget(top); pdpy = XtOpenDisplay(appc, /* Display String */ ":1", "print", "Print", NULL, 0, &argc, argv); if (!pdpy) { fprintf(stderr, "Cannot connect to :1\n"); exit(1); } plist = XpGetPrinterList(pdpy, "", &nlist); if (nlist) for (i=0; i