Path: utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!cica!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ucbvax!odi.com!bob From: bob@odi.com (Bob Miner) Newsgroups: comp.windows.x.motif Subject: Re: Application Icons Message-ID: <9009201348.AA01313@hendrix.odi.com> Date: 20 Sep 90 13:48:47 GMT References: <9009192157.AA08766@alphalpha.com> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 51 I'm sure this has been discussed here before but I can't seem to find any record of it. Does anyone have a working example of setting the application icon from within the application? -kee In Motif, create a single plane bitmap of the proper size (usually 48x48, but technically one should call XGetIconSizes to determine the sizes which the window manager wants) and then set the XmNiconPixmap resource of your application's shell widget. In my code this looks something like: creating bitmap: Display* display; Drawable rootWin; unsigned int width; unsigned int height; char* iconBits; // the output from 'bitmap' Pixmap iconPixmap; iconPixmap = XCreateBitmapFromData( display, rootWin, iconBits, width, height); creating shell widget: XtSetArg( argList[i], XmNiconPixmap, iconPixmap); i++; appShell = XtAppCreateShell( (String) appName, (String) appClass, applicationShellWidgetClass, display, argList, i); Sorry that this isn't a working example, but I had to cut these code fragments out of a larger C++ program and I don't have time to paste them all together. Bob Miner ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OOOOOOO ~ Bob Miner OOOO OOOO ~ Object Design, Inc. OOOOO OOOOO ~ 1 New England Executive Park OOOOO OOOOO ~ Burlington, MA 01803 USA OOOO OOOO ~ bob@odi.com or uunet!odi!bob OOOOOOO bject Design Inc. ~ voice: (617) 270-9797 FAX: (617) 270-3509 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "From there to here, from here to there, funny things are everywhere." - Dr. Seuss ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~