At 17:53 11.01.03 -0500, Rene Olsthoorn wrote:
[...]
>Now, an other thing I noticed: On windows, every window gets a little
snake icon in the left-top corner.
>Ofcourse I'm proud to use Python, that's not the issue. But is it possible
to replace the icon with an other icon? Has anyone managed to do that?
>
Replacig the Icon from Python/PyGtk isn't possible with the current
code in gtk+/gdk/win32/gdkwindow-win32.c:RegisterGdkClass

Window icons on windoze are WindowClass specific. You can set them on
creation of the window class which is done deep in gdk.

The current (for about three years?) code does the following:

if (the main executable has an icon) ;
        use it
elif (the gdk dll has an icon) :
        use it
else :
        use standard icon IDI_APPLICATION

This works nice for the non scripting case, i.e. you have
a main application where you can place an icon. This is
how it is done for Dia, The Gimp and some of it's plug-ins.

In the PyGtk case the 'main application' is python.exe, which
has the little sanke icon.

To support replacing the window icon from Python one of the 
following would be needed :
- Add a windoze only function to gdk to replace the icon
  before it's first use; modify RegisterGdkClass
- (?) Add some window class fiddling code to pygtk which
  finally uses SetClassLong(hWnd, GCL_HICON, hNewIcon)
- Implement gdk_window_set_icon() for win32. See my
  and Tor's comments in the respective gdk code. 

IMHO nothing of this is worth the effort ...

        Hans
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to