Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc.cso.uiuc.edu!tank!eecae!cps3xx!usenet From: usenet@cps3xx.UUCP (Usenet file owner) Newsgroups: comp.windows.x Subject: Re: icon geometries? Keywords: icon bitmaps Message-ID: <3610@cps3xx.UUCP> Date: 30 Jun 89 18:49:15 GMT References: <7484@cs.Buffalo.EDU> Reply-To: destefan@frith.egr.msu.edu (John F. DeStefano) Organization: Michigan State University, Computer Science, E. Lansing Lines: 122 We are running X-11 R3. "xterm" has a # option that will set the icon geometry. The only place I found information on it was in "xterm -help". An example is: xterm -g 80x24+0+0 -C -iconic -name "CONSOLE" -xb $HOME/.tinysun.xbm \#+894+62 The backslash in front of the # sign is so that csh doesn't take the rest of the line as a comment. As for having bitmaps as icons a news article by Suresh Krishnamurthy shows how to patch xterm to allow this. I have applied the patches to a copy of xterm here and they seem to work really well. Here is the article: cps3xx!eecae!shadooby!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!tektronix!orca!krish From: krish@orca.WV.TEK.COM (Shelley Gallaher) Newsgroups: comp.windows.x Subject: Icon bitmap for (X11) xterms Message-ID: <3311@orca.WV.TEK.COM> Date: 11 May 89 23:52:45 GMT Reply-To: krish@orca.WV.TEK.COM (Suresh Krishnamurthy) Organization: Tektronix, Inc., Wilsonville, OR. Lines: 86 Keywords: xterm, icon, bitmap I have modified (X11) xterm to display bitmap for icons. You have to change only main.c file. The syntax is similar to X10 xterm, except that instead of "-ib", I have used "-xb" (xterm bitmap). "xterm -iconic -xb bitmap_filename" would invoke xterm as an icon using specified file as icon bitmap. Note that bitmap_filename should include the path also. Good bye labels, hello bitmap icons. -- Suresh ------------------------------------------------------------------------------- Suresh Krishnamurthy Net: krish@gray.WV.TEK.COM Hinditron International Inc, ARPA: krish%gray.WV.TEK.COM@RELAY.CS.NET (Work) (503)-685-2973 UUCP: gray.WV.TEK.COM!krish@uunet.UU.NET ------------------------------------------------------------------------------- Here are the diffs for main.c in R3. ---------------------- beginning of main.c (R3) diff ------------------------- 246a247,248 #define MAKE_ICON /* I think this should be defined in Makefile */ 251a254,256 #ifdef MAKE_ICON char *iconfile; #endif MAKE_ICON 276a282,285 #ifdef MAKE_ICON {"iconFile", "IconFile", XtRString, sizeof(char *), offset(iconfile), XtRString, (caddr_t) NULL}, #endif MAKE_ICON 340a350,352 #ifdef MAKE_ICON {"-xb", "*iconFile", XrmoptionSepArg, (caddr_t) NULL}, #endif MAKE_ICON 1085a1098,1100 #ifdef MAKE_ICON Pixmap xtermPixmap; #endif MAKE_ICON 1245c1260,1262 --- #ifdef MAKE_ICON MakeCuteIcon( resource.iconfile ); /* Set icon pixmap */ #endif MAKE_ICON 2275a2293,2325 #ifdef MAKE_ICON MakeCuteIcon( icon_filename ) char *icon_filename; { int junk; Pixmap xtermPixmap; XWMHints wmhints, *hints; if (!strlen(icon_filename)) /* if no icon file specified */ return; XReadBitmapFile( XtDisplay(XtParent(term)), XtWindow(XtParent(term)), icon_filename, &junk, &junk, &xtermPixmap, &junk, &junk ); /* * Get WMHints and save initial_state and position, otherwise * iconic option and icon position may not work properly. */ hints = XGetWMHints( XtDisplay(XtParent(term)), XtWindow(XtParent(term)) ); wmhints.flags = InputHint | StateHint | IconPixmapHint | IconPositionHint; wmhints.initial_state = hints->initial_state; /* take care of iconic */ wmhints.input = hints->input; wmhints.icon_pixmap = xtermPixmap; wmhints.icon_x = hints->icon_x; /* restore icon position */ wmhints.icon_y = hints->icon_y; XSetWMHints( XtDisplay(XtParent(term)), XtWindow(XtParent(term)), &wmhints); } #endif MAKE_ICON ---------------------- end of main.c (R3) diff ------------------------- I hope this helps... John /------\ +----------------------------------+ +----------------------------------+ | John F. DeStefano | | COGITO COGITO, ERGO COGITO SUM | | CPS Undergraduate -- AI/KBS +------+ "I think that I think; | | Michigan State University +------+ therefore, I think I am." | | destefan@frith.egr.msu.edu | | - Ambros Bierce | +----------------------------------+ +----------------------------------+ \------/