[comp.windows.x] summary : title in title bar

franco@cs.UAlberta.CA (Franco Carlacci) (03/21/90)

I'd like to thank all the people we replied to my query on changing
the title in the title bar in twm. Many  of the replies said that this was
done via escape sequence. Tom LaStrange was kind enough to send the code
for mytitle.c. It too does the title change via escape sequences. As for doing
it via Xlib calls, I put this together. I have no idea if this better or
worse than escape squences; I wrote it only to see if it could be done.
BTW, if anyone is interested in what I got, send me an email message.

Thanks again,

franco

----------------------------------------------------------------------
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>

main()

{
  Display *dpy;
  int scr;
  Window win,rw;
  char **name;
  int xw,yw;
  int xr,yr;
  unsigned int butt;

  dpy = XOpenDisplay("");
  if (!dpy) {
    fprintf(stderr,"Can't open display\n");
    exit(1);
  }
  XQueryPointer(dpy,
                DefaultRootWindow(dpy),
                &win,&rw,&xr,&yr,&xw,&yw,&butt);
  XTranslateCoordinates(dpy,
			DefaultRootWindow(dpy),
			rw,
			xr,yr,&xw,&yw,&win);
  XFetchName(dpy,win,&name);
  fprintf(stderr,"name is: <%s>\n",name);
  XStoreName(dpy,win,getcwd(NULL,100));
  XFree(name);
  XFlush(dpy);
  XCloseDisplay(dpy);
}  


--
 Franco Carlacci               | "No distance of place or lapse of time can 
 VOX: (403)492-2428 or -2821   |  lessen the friendship of those who are thor- 
 UUCP: franco@alberta.uucp     |  oughly persuaded of each other's worth" 
 franco@cs.ualberta.ca         |                Robert Southey