[gtkada] [Fwd: Re: windows_icon .. how to?]
manuel.op.de.coul at eon-benelux.com
manuel.op.de.coul at eon-benelux.com
Fri Oct 25 18:39:23 CEST 2002
Here's a useful post that appeared on the Gtk list.
It was discussed before that the Set_Icon call doesn't do
anything under Windows, you have to put a resource in the
executable. Until now, I've done this by hand after linking,
but gnatmake can do it too, which I didn't know yet. This
is much more convenient.
After creating the file myapp.res you need to put the
following at the end of your gnatmake command:
-largs myapp.res -mwindows
Manuel
------------------------------------------------------------
calmar wrote:
> Hi,
> I found the function:
> iconw = gdk_image_new_from_file ("icon.xpm");
> but it still don't work.
> Well actually I make the program in MSWindows..maybe this is the
> reason..it should work now, isn it?
Hi Calmar,
Did you ever get this to work ?
YEP, yesterday with a hint from Tor (tml)in the Yahoo groups.
He said, you have to build a resource for your program, and there would be
no way without in MS windows, because the main windows of a gtk programm
seems to be a 'real' MS windows (declared like this), and this needs the
resource .. hmm.
First you have to make a resource file:
windres myapp.rc -O coff -o myapp.res
and linking with:
gcc -mwindows myapp.o myapp.res -o myapp.exe
(according to: http://www.cygwin.com/cygwin-ug-net/windres.html )
In my special case:
my blackj.rc:
1 ICON "blackj.ico"
and the icon in the same folder.
then I typed this: (result -> blackj.res)
windres blackj.rc -O coff -o blackj.res
..and finally I placed the blackj.res just behind the object files while
linking, in order to link it together.
gcc black.o blackj.res -o black.exe $(LFLAGS)
I hope it works!
calmar
More information about the gtkada
mailing list