Re: Setting the window icon (under Win32)
- From: Martyn Russell <jackrussell subdimension com>
- To: gtk-devel-list gnome org
- Subject: Re: Setting the window icon (under Win32)
- Date: 02 Mar 2002 11:45:55 +0000
On Sat, 2002-03-02 at 11:25, Tor Lillqvist wrote:
> Martyn Russell writes:
> > I have managed to use the gdk_window_set_icon function successfully
> > using gtk 1.2.10 under Redhat 7.2. However, when I check the same code
> > out to my WindowsNT box to see if it works correctly, it doesnt.
>
> Yep. gdkwindow-win32.c:gdk_window_set_icon() has this comment by me:
>
> /* Nothing to do, really. As we share window classes between windows
> * we can't have window-specific icons, sorry. Don't print any warning
> * either.
> */
>
> (I wonder how much overhead a window class is? Would it be worth it to
> have individual window classes for each top-level window just to have
> the gdk_window_set_icon() functionality?)
>
> gdk_window_set_icon_list() does have a comment by Hans Breuer
> indicating that it might be possible to implement it even with shared
> window classes:
>
> /* We could convert it to a hIcon and DrawIcon () it when getting
> * a WM_PAINT with IsIconic, but is it worth it ? Same probably
> * goes for gdk_window_set_icon (). Patches accepted :-) --hb
> * Or do we only need to deliver the Icon on WM_GETICON ?
> */
>
> However, if I understand the MS Platform SDK documentation right, the
> WM_PAINT message is sent to paint a minimized (i.e., iconified) window
> only if the window class icon is set to NULL. That would mean that in
> order to implement gdk_window_set_icon(), GDK would have to paint
> *all* icons manually, I think.
That doesnt make sence... why would they ONLY draw when there is NO icon
to draw?? From my limited experience of windows, setting the icon only
requires a hWnd (handle to the window) and a hIcon (handle to the icon)
the rest is handled by windows. Even if windows are sharing the same
class, surely the windows themselves dont physically share the same
handle (hWnd).
(But if the code were there anyway, so
> what.) I don't know what happens to the icons in the Alt-Tab task
> switcher if the window class icon is NULL, maybe you get the default
> (ugly) Windows icon there then? Or is there some other, more obscure,
> API to paint that icon on demand?
>
Yes I think this is the case (it does use the windows default ugly
icon).
> Seems like there is a need for some experimentation and Google search
> for sample code here. Some day. The gdk_window_set_icon()
> functionality is not *that* important, is it?
>
> --tml
>
I have done some coding to set icons under windows and it is relatively
simple to do, Im unsure as to why this is difficult to do, maybe i need
to see the code to understand it better.
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Regards,
Martyn
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]