[gtkada] Re: Windows Icons

Stefan Bellon sbellon at sbellon.de
Sat Jan 14 00:59:04 CET 2006


JoeyF (sent by Nabble.com) wrote:

> I am trying to add a new icon to the upper left hand corner of a
> Gtk_Window  I see that you can set_icon in a Gdk_Window type, but I
> don't see how to do this with Gtk_Window.  Is there a way to do this?

You can get the Gdk_Window of a Gtk_Window by calling
Gtk.Window.Get_Window. But this only works on UNIX like operating
systems AFAICT. On Windows, if you want to set the icon in the top left
corner of the window decoration, you have to do it otherwise. You
didn't specify the operating system you're using. On Windows, you need
a rc file which contains a reference to an ico icon:

AppIcon ICON "myappicon.ico"

Then you have to call windres on this rc file which generates an
ordinary object file. Link this object file against your application
and the windows have your icon in the top left corner.

At least this is how I do it. If it's easier on Windows, I'd be
grateful to know how.

-- 
Stefan Bellon



More information about the gtkada mailing list