Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!osf.org!dbrooks From: dbrooks@osf.org Newsgroups: comp.windows.x.motif Subject: Application icons Message-ID: <9009200319.AA12619@penge.osf.org> Date: 20 Sep 90 03:19:40 GMT Sender: usenet@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 50 This is a slightly edited, and motified, version of the routine that xrn uses to set the application icon: /* This file defines "bits", "width" and "height" */ #include "standard.bitmap.file" void xmIconCreate() { Pixmap icon_pixmap = (Pixmap) 0; Arg arg; /* Check if the user defined an icon already */ XtSetArg(arg, XmNiconPixmap, &icon_pixmap); XtGetValues(TopLevel, &arg, 1); /* User didn't, so set it */ if (icon_pixmap == (Pixmap) 0) { XtSetArg(arg, XmNiconPixmap, XCreateBitmapFromData(XtDisplay(TopLevel), XtScreen(TopLevel)->root, bits, width, height)); XtSetValues(TopLevel, &arg, 1); } /* Did the user set the "iconGeometry" resource? */ if (app_resources.iconGeometry != NIL(char)) { int scr, x, y, junk; Arg args[2]; /* Find the appropriate screen and set the geometry */ for(scr = 0; /* yyuucchh */ XtScreen(TopLevel) != ScreenOfDisplay(XtDisplay(TopLevel), scr); scr++); XGeometry(XtDisplay(TopLevel), scr, app_resources.iconGeometry, "", 0, 0, 0, 0, 0, &x, &y, &junk, &junk); XtSetArg(args[0], XmNiconX, x); XtSetArg(args[1], XmNiconY, y); XtSetValues(TopLevel, args, XtNumber(args)); } } -- David Brooks dbrooks@osf.org Systems Engineering, OSF uunet!osf.org!dbrooks Experience Hackvergnuegen!