comp.lang.ada
 help / color / mirror / Atom feed
* GtkAda / Ada Newbie Question
@ 2003-11-11 23:11 J Cusick
  2003-11-12  1:10 ` Ludovic Brenta
  0 siblings, 1 reply; 4+ messages in thread
From: J Cusick @ 2003-11-11 23:11 UTC (permalink / raw)


I'm new to both Ada and GtkAda and have a question regarding my first
basic hello world program.

These are the lines in question:

procedure Simple is
   S_Window : Gtk.Window;
   S_Button : Gtk.Button;

and this is the error I get when attempting gnatmake:

simple.adb:8:18: subtype mark required in this context simple.adb:8:18:
found "Window" declared at gtk-window.ads:59 simple.adb:9:18: subtype mark
required in this context simple.adb:9:18: found "Button" declared at
gtk-button.ads:41

This is of course followed by subsequent errors along the lines of:

simple.adb:28:07: must be an access-to-object type

every place that S_Window or S_Button shows up.

I have absolutely no clue what this error is telling me. What is a
"subtype mark" and how do I supply one?

As I have mentioned, I'm just starting to climb the learning curve for
both Ada and GtkAda, so any help or pointers are greatly
appreciated.Thanks for any answers regarding this question.

Regards,

John C.




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

* Re: GtkAda / Ada Newbie Question
  2003-11-11 23:11 GtkAda / Ada Newbie Question J Cusick
@ 2003-11-12  1:10 ` Ludovic Brenta
  2003-11-12  4:00   ` J Cusick
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Brenta @ 2003-11-12  1:10 UTC (permalink / raw)


"J Cusick" <Joe@Smoke.not> writes:

> I'm new to both Ada and GtkAda and have a question regarding my first
> basic hello world program.
> 
> These are the lines in question:
> 
> procedure Simple is
>    S_Window : Gtk.Window;
>    S_Button : Gtk.Button;
> 
> and this is the error I get when attempting gnatmake:
> 
> simple.adb:8:18: subtype mark required in this context simple.adb:8:18:
> found "Window" declared at gtk-window.ads:59 simple.adb:9:18: subtype mark
> required in this context simple.adb:9:18: found "Button" declared at
> gtk-button.ads:41
> 
> This is of course followed by subsequent errors along the lines of:
> 
> simple.adb:28:07: must be an access-to-object type
> 
> every place that S_Window or S_Button shows up.
> 
> I have absolutely no clue what this error is telling me. What is a
> "subtype mark" and how do I supply one?

Loosely speaking, a subtype mark is the name of a type or subtype.  If
you need a formal definition of this or other terms, see the Ada
Reference Manual but this is not for the faint of heart.  Here, you
supplied the names of two packages instead of names of types or
subtypes.  You should have said:

S_Window : Gtk.Window.Gtk_Window_Record;
S_Button : Gtk.Button.Gtk_Button_Record;

> As I have mentioned, I'm just starting to climb the learning curve for
> both Ada and GtkAda, so any help or pointers are greatly
> appreciated.Thanks for any answers regarding this question.
> 
> Regards,
> 
> John C.

Here are a few hints:

1) Use glade2 to build your user interface using a point-and-click
   interface, then use gate2 to generate Ada code from the .glade
   file.  Then, study how the generated Ada code works.  There are
   also several examples that come with GtkAda, one of which is hello
   world.

2) Go to http://libre.act-europe.fr/GtkAda and subscribe to the
   mailing lists there.  Questions specific to GtkAda are best
   answered there.

3) Study the *.ads files provided with GtkAda.  They include a wealth
   of documentation in comments.  For example, the file
   "gtk-window.ads" contains the specification for the package
   Gtk.Window.

HTH

-- 
Ludovic Brenta.




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

* Re: GtkAda / Ada Newbie Question
  2003-11-12  1:10 ` Ludovic Brenta
@ 2003-11-12  4:00   ` J Cusick
  2003-11-12 12:51     ` Preben Randhol
  0 siblings, 1 reply; 4+ messages in thread
From: J Cusick @ 2003-11-12  4:00 UTC (permalink / raw)


On Wed, 12 Nov 2003 02:10:14 +0100, Ludovic Brenta wrote:

> "J Cusick" <Joe@Smoke.not> writes:
> 
>> I'm new to both Ada and GtkAda and have a question regarding my first
>> basic hello world program.
>> 
>> These are the lines in question:
>> 
>> procedure Simple is
>>    S_Window : Gtk.Window;
>>    S_Button : Gtk.Button;
>> 
>> and this is the error I get when attempting gnatmake:
>> 
>> simple.adb:8:18: subtype mark required in this context 
>> every place that S_Window or S_Button shows up.

...

>> I have absolutely no clue what this error is telling me. What is a
>> "subtype mark" and how do I supply one?

...
 
> Loosely speaking, a subtype mark is the name of a type or subtype.  If you
> need a formal definition of this or other terms, see the Ada Reference
> Manual but this is not for the faint of heart.  Here, you supplied the
> names of two packages instead of names of types or subtypes.  You should
> have said:
> 
> S_Window : Gtk.Window.Gtk_Window_Record; S_Button :
> Gtk.Button.Gtk_Button_Record;
> 
>> As I have mentioned, I'm just starting to climb the learning curve for
>> both Ada and GtkAda, so any help or pointers are greatly
>> appreciated.Thanks for any answers regarding this question.

...
 
> Here are a few hints:
> 
> 1) Use glade2 to build your user interface using a point-and-click
>    interface, then use gate2 to generate Ada code from the .glade file. 
>    Then, study how the generated Ada code works.  There are also several
>    examples that come with GtkAda, one of which is hello world.
> 
> 2) Go to http://libre.act-europe.fr/GtkAda and subscribe to the
>    mailing lists there.  Questions specific to GtkAda are best answered
>    there.
> 
> 3) Study the *.ads files provided with GtkAda.  They include a wealth
>    of documentation in comments.  For example, the file "gtk-window.ads"
>    contains the specification for the package Gtk.Window.
> 
> HTH

Ludovic,

Thanks for the excellent pointers. This helps a great deal.
The ADA Ref. Man. is indeed not for the feint of heart :-),
I tried there first.

However, the other pointers are a good start for me.

Regards, and thanks again...

John C.



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

* Re: GtkAda / Ada Newbie Question
  2003-11-12  4:00   ` J Cusick
@ 2003-11-12 12:51     ` Preben Randhol
  0 siblings, 0 replies; 4+ messages in thread
From: Preben Randhol @ 2003-11-12 12:51 UTC (permalink / raw)


On 2003-11-12, J Cusick <JoeSmoke@hotmail.com> wrote:
>
> Thanks for the excellent pointers. This helps a great deal.
> The ADA Ref. Man. is indeed not for the feint of heart :-),
> I tried there first.

There are some nice online books on Ada95 freely downloadable from here:

   http://www.adapower.com/learn/

Don't read the RM befor you have read those.

-- 
"Saving keystrokes is the job of the text editor, not the programming
 language."



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

end of thread, other threads:[~2003-11-12 12:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-11 23:11 GtkAda / Ada Newbie Question J Cusick
2003-11-12  1:10 ` Ludovic Brenta
2003-11-12  4:00   ` J Cusick
2003-11-12 12:51     ` Preben Randhol

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