comp.lang.ada
 help / color / mirror / Atom feed
* set programm icon
@ 2004-06-14 16:22 Tanker
  2004-06-14 17:18 ` Jano
  0 siblings, 1 reply; 10+ messages in thread
From: Tanker @ 2004-06-14 16:22 UTC (permalink / raw)


Hi,
I want to set up a program icon for my program, but I have no idea how to do
that. I'm using Adagide and the Gnat compiler 3.13p.

Thanx in advance
Flo





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: set programm icon
  2004-06-14 16:22 set programm icon Tanker
@ 2004-06-14 17:18 ` Jano
  2004-06-14 18:17   ` Tanker
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jano @ 2004-06-14 17:18 UTC (permalink / raw)


Tanker wrote:
> Hi,
> I want to set up a program icon for my program, but I have no idea how to do
> that. I'm using Adagide and the Gnat compiler 3.13p.

I've done it with 3.15p, I don't know if it works with previous versions.

Install gnatwin from ACT europe, there is a windows resources compiler 
(rcl I think). Create a .rc file (you can use visual studio or do it by 
hand, google should provide enough info) pointing to your icon. Compile 
with rcl the resource file and you'll get a .o object file. Include that 
file in the compiler chain to get it linked with your executable and voil�!



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: set programm icon
  2004-06-14 17:18 ` Jano
@ 2004-06-14 18:17   ` Tanker
  2004-06-14 18:18   ` tmoran
  2004-06-14 18:42   ` Tanker
  2 siblings, 0 replies; 10+ messages in thread
From: Tanker @ 2004-06-14 18:17 UTC (permalink / raw)


Hi,
it worked perfectly: the rcl compiler created the *.o file from the *.rc
file. Now I still got a problem: How can I include that file in the compiler
chain in order to get it linked with my exe file?

Thanx again


"Jano" <notelacreas@porfavor.no> schrieb im Newsbeitrag
news:2j6500Fu5ef7U1@uni-berlin.de...
> Tanker wrote:
> > Hi,
> > I want to set up a program icon for my program, but I have no idea how
to do
> > that. I'm using Adagide and the Gnat compiler 3.13p.
>
> I've done it with 3.15p, I don't know if it works with previous versions.
>
> Install gnatwin from ACT europe, there is a windows resources compiler
> (rcl I think). Create a .rc file (you can use visual studio or do it by
> hand, google should provide enough info) pointing to your icon. Compile
> with rcl the resource file and you'll get a .o object file. Include that
> file in the compiler chain to get it linked with your executable and
voil�!





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: set programm icon
  2004-06-14 17:18 ` Jano
  2004-06-14 18:17   ` Tanker
@ 2004-06-14 18:18   ` tmoran
  2004-06-14 18:42   ` Tanker
  2 siblings, 0 replies; 10+ messages in thread
From: tmoran @ 2004-06-14 18:18 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

>Compile with rcl the resource file and you'll get a .o object file.
>Include that file in the compiler chain to get it linked with your
>executable and voil�!
  From an earlier article:
>Subject: Announce: .rc files with Gnat
>Date: 2002-04-14 20:06:04 PST
>David Botton tells me
>www.adapower.com/os/wglink.html
>now contains a linker shell I wrote to automatically handle Windows .rc
>files with Gnat.  It should make life a little easier for both newbies
>and professionals using Gnat with MS Windows.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: set programm icon
  2004-06-14 17:18 ` Jano
  2004-06-14 18:17   ` Tanker
  2004-06-14 18:18   ` tmoran
@ 2004-06-14 18:42   ` Tanker
  2004-06-14 19:34     ` tmoran
                       ` (2 more replies)
  2 siblings, 3 replies; 10+ messages in thread
From: Tanker @ 2004-06-14 18:42 UTC (permalink / raw)


It works as far as the *.o file is created. I tried it with the wglink.exe
but the gnat compiler tells me, that he cant find the wglink.exe! (gnatmake
xfile.adb --GNATLINK=wglink.exe <enter>  --- in the directory where the file
to bind is)

how can I only include the *.o file in my source code? Do I have to use the
command:
pragma linker_options("icon.o");

I tried it, but the result isn't what i want it to be: the programicon is
still the standard icon.



"Jano" <notelacreas@porfavor.no> schrieb im Newsbeitrag
news:2j6500Fu5ef7U1@uni-berlin.de...
> Tanker wrote:
> > Hi,
> > I want to set up a program icon for my program, but I have no idea how
to do
> > that. I'm using Adagide and the Gnat compiler 3.13p.
>
> I've done it with 3.15p, I don't know if it works with previous versions.
>
> Install gnatwin from ACT europe, there is a windows resources compiler
> (rcl I think). Create a .rc file (you can use visual studio or do it by
> hand, google should provide enough info) pointing to your icon. Compile
> with rcl the resource file and you'll get a .o object file. Include that
> file in the compiler chain to get it linked with your executable and
voil�!





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: set programm icon
  2004-06-14 18:42   ` Tanker
@ 2004-06-14 19:34     ` tmoran
  2004-06-15  9:11     ` Jano
  2004-06-15 21:22     ` Pascal Obry
  2 siblings, 0 replies; 10+ messages in thread
From: tmoran @ 2004-06-14 19:34 UTC (permalink / raw)


>but the gnat compiler tells me, that he cant find the wglink.exe! (gnatmake
>xfile.adb --GNATLINK=wglink.exe <enter>  --- in the directory where the file
>to bind is)
  Try "--GNATLINK=thefullpath\wglink"
or put the wglink.exe in the working directory from which you are running
gnatmake.

>how can I only include the *.o file in my source code? Do I have to use the
>command:
>pragma linker_options("icon.o");
  The readme.txt that came with wglink says:
>To use wglink, add appropriate 'pragma linker_options("abc.rc")'
>to the Ada source code, ...



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: set programm icon
  2004-06-14 18:42   ` Tanker
  2004-06-14 19:34     ` tmoran
@ 2004-06-15  9:11     ` Jano
  2004-06-15 16:23       ` Tanker
  2004-06-15 21:22     ` Pascal Obry
  2 siblings, 1 reply; 10+ messages in thread
From: Jano @ 2004-06-15  9:11 UTC (permalink / raw)


Tanker wrote:
> It works as far as the *.o file is created. I tried it with the wglink.exe
> but the gnat compiler tells me, that he cant find the wglink.exe! (gnatmake
> xfile.adb --GNATLINK=wglink.exe <enter>  --- in the directory where the file
> to bind is)
> 
> how can I only include the *.o file in my source code? Do I have to use the
> command:
> pragma linker_options("icon.o");
> 
> I tried it, but the result isn't what i want it to be: the programicon is
> still the standard icon.

I've done it without special tools... wait a minute while I look for a 
makefile I have somewhere...

Ok... it seems I simply add to the gnatmake the obj as a linker argument:

gnatmake whatever.adb -o whatever.exe -largs path/to/obj/icon.o

However the pragma linker_options should give the same result... :/

Hope this helps.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: set programm icon
  2004-06-15  9:11     ` Jano
@ 2004-06-15 16:23       ` Tanker
  2004-06-15 19:34         ` Bernd Specht
  0 siblings, 1 reply; 10+ messages in thread
From: Tanker @ 2004-06-15 16:23 UTC (permalink / raw)


Thanx Jano, it almost worked perfectly! But the programicon in the upper
left corner of the programwindow is still the standardicon and not my
programicon (shown in the explorer!)
Maby someone can tell my the parameter for the gnat compiler?

Thanx a lot !!!

"Jano" <notelacreas@porfavor.no> schrieb im Newsbeitrag
news:2j7spuFubm8rU1@uni-berlin.de...
> Tanker wrote:
> > It works as far as the *.o file is created. I tried it with the
wglink.exe
> > but the gnat compiler tells me, that he cant find the wglink.exe!
(gnatmake
> > xfile.adb --GNATLINK=wglink.exe <enter>  --- in the directory where the
file
> > to bind is)
> >
> > how can I only include the *.o file in my source code? Do I have to use
the
> > command:
> > pragma linker_options("icon.o");
> >
> > I tried it, but the result isn't what i want it to be: the programicon
is
> > still the standard icon.
>
> I've done it without special tools... wait a minute while I look for a
> makefile I have somewhere...
>
> Ok... it seems I simply add to the gnatmake the obj as a linker argument:
>
> gnatmake whatever.adb -o whatever.exe -largs path/to/obj/icon.o
>
> However the pragma linker_options should give the same result... :/
>
> Hope this helps.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: set programm icon
  2004-06-15 16:23       ` Tanker
@ 2004-06-15 19:34         ` Bernd Specht
  0 siblings, 0 replies; 10+ messages in thread
From: Bernd Specht @ 2004-06-15 19:34 UTC (permalink / raw)


"Tanker" <Tanker93@hotmail.com> wrote in
news:can7h9$ahd$04$1@news.t-online.com: 

> Thanx Jano, it almost worked perfectly! But the programicon in the
> upper left corner of the programwindow is still the standardicon and
> not my programicon (shown in the explorer!)
> Maby someone can tell my the parameter for the gnat compiler?
> 
> Thanx a lot !!!


Hi,

it works for me since GNAT 3.12p. I don't use RCL, I use RC and CVTRES which 
comes (for example) with Aonix (the special edition included in Barnes 
book). 

Here is what I do:

In the resource-file:

#include "resourceid.h"


// Icon

AM_ICON  ICON  DISCARDABLE  "GENERIC.ICO"


In the ada-source:

 wndclass.hIcon  := LoadIcon (hInstance, 
                              LPCSTRofIntResource(ResourceID.AM_ICON));



You do not need the linker_options. When you work with an actual version of 
AdaGide, then you can include your resource-file in the build process:
 
"Tools" -> ""Resource Options" -> "Resource file"

Enter here the name of your resource-file. 

You can choose different resource compilers here:

"Tools" -> ""Resource Options" -> "Resource compiler"




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: set programm icon
  2004-06-14 18:42   ` Tanker
  2004-06-14 19:34     ` tmoran
  2004-06-15  9:11     ` Jano
@ 2004-06-15 21:22     ` Pascal Obry
  2 siblings, 0 replies; 10+ messages in thread
From: Pascal Obry @ 2004-06-15 21:22 UTC (permalink / raw)



"Tanker" <Tanker93@hotmail.com> writes:

> It works as far as the *.o file is created. I tried it with the wglink.exe
> but the gnat compiler tells me, that he cant find the wglink.exe! (gnatmake
> xfile.adb --GNATLINK=wglink.exe <enter>  --- in the directory where the file
> to bind is)

I think you should first update to GNAT 3.15p and read the documentation about
compiling resources.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-06-15 21:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-14 16:22 set programm icon Tanker
2004-06-14 17:18 ` Jano
2004-06-14 18:17   ` Tanker
2004-06-14 18:18   ` tmoran
2004-06-14 18:42   ` Tanker
2004-06-14 19:34     ` tmoran
2004-06-15  9:11     ` Jano
2004-06-15 16:23       ` Tanker
2004-06-15 19:34         ` Bernd Specht
2004-06-15 21:22     ` Pascal Obry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox