Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: this is weird



>>>>> "Scott" == Scott Stone <sstone@example.com> writes:

    Scott> Why is it an insanely non-trivial task to set the titlebar
    Scott> text of a window in X?  I'm using a library which does not
    Scott> use Xt, or Tk, or Motif.  Basically it does:

    Scott> XOpenDisplay() gets DefaultScreen() gets DefaultVisual()
    Scott> gets DefaultDepth() gets RootWindow() calls XCreateWindow()
    Scott> calls XMapWindow()

    Scott> and then does framebuffer operations directly in the
    Scott> window... how do I set the titlebar text?


Scott,

	As Marcus mentioned, you need to do this by way of the window
manager. The simplest way is to give a -name parameter on the command
line. To do it from within your program, you have to set the WM_NAME
property on the window. I think you do this via the xlib function: 

     XChangeProperty(display, w, property, type, format, mode,
     data, nelements)
           Display *display;
           Window w;
           Atom property, type;
           int format;
           int mode;
           unsigned char *data;
           int nelements;

Where property is: 
Xatom.h:#define XA_WM_NAME ((Atom) 39)

See the XGetWindowProperty man page for details.

Andy
--------------------------------------------------------------
Next TLUG Meeting: 13 June Sat, Tokyo Station Yaesu gate 12:30
Featuring Stone and Turnbull on .rpm and .deb packages
Next Nomikai: (?) July, 19:30 Tengu TokyoEkiMae 03-3275-3691
--------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links