From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6f3798af21a89421 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-11 17:10:48 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!news.cambrium.nl!news.cambrium.nl!news.cambrium.nl!skynet.be!skynet.be!skynet.be!skynet.be!louie!tlk!not-for-mail Sender: lbrenta@lbrenta Newsgroups: comp.lang.ada Subject: Re: GtkAda / Ada Newbie Question References: From: Ludovic Brenta User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Date: 12 Nov 2003 02:10:14 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 81.241.16.249 X-Trace: 1068599415 reader0.news.skynet.be 2245 81.241.16.249:47475 X-Complaints-To: usenet-abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:2390 Date: 2003-11-12T02:10:14+01:00 List-Id: "J Cusick" 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.