| Store | Cart

[Tkinter] LONG POST ALERT: Setting application icon on Linux

From: Tim Jarman <t...@SPAMLESSjarmania.com>
Sun, 27 Mar 2005 18:01:41 +0100
Jeff Epler wrote:

> Here is a short program that sets Tk's window icon on Linux.  My window> manager is icewm, and it uses a scaled version of the "flagup" image> both at the upper-left corner of the window and on the task bar entry> for the window.> >     import Tkinter>     app = Tkinter.Tk()>     app.iconbitmap("@/usr/X11R6/include/X11/bitmaps/flagup")>     app.mainloop()> > As often happens, the Tkinter documentation doesn't tell the whole> story---you have to dig into the Tk documentation.  I started with "man> n wm", and read the following:>     If  bitmap is specified, then it names a bitmap in the standard>     forms accepted by Tk (see the  Tk_GetBitmap  manual  entry for>     details).> OK, on to Tk_GetBitmap...>     @fileName     FileName  must  be the name of a file containing a>                   bitmap description in the standard X11 or X10 format.> and I happened to know that some bitmaps in this format exist in the> directory I mentioned above.  Note that the "standard X11 format" is> monochrome, so you will not be able to use color images with> "iconbitmap" on Linux.  Tk doesn't support _NET_WM_ICON for setting> full-color icons.> > Jeff

Thanks for this, Jeff - I'll do some digging in the Tk docs. My problem is
that I'm trying to use iconwindow() to use a colour image, as opposed to
iconbitmap(), although if push comes to shove I suppose I could use that.

Thanks again for the quick response - on Easter weekend too!

Tim J

-- 
Website: www DOT jarmania FULLSTOP com

Recent Messages in this Thread
Tim Jarman Mar 27, 2005 12:27 pm
Jeff Epler Mar 27, 2005 04:21 pm
Jeff Epler Mar 31, 2005 03:05 am
Tim Jarman Mar 31, 2005 11:04 am
Tim Jarman Mar 27, 2005 05:01 pm
Messages in this thread