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,83e6a30aa3ca4e22 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-16 14:10:05 PST Path: supernews.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!cyclone.bc.net!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Ada newbie! Date: 16 Apr 2001 16:58:32 -0400 Organization: NASA Goddard Space Flight Center Message-ID: References: <3ADB4F1C.AA362C9E@ida.his.se> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 987455610 27685 128.183.220.71 (16 Apr 2001 21:13:30 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 16 Apr 2001 21:13:30 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 Xref: supernews.google.com comp.lang.ada:6927 Date: 2001-04-16T21:13:30+00:00 List-Id: Michael Andersson writes: > Hi! > Can somebody please help me convert the following c statement to Ada? > gtk_widget_draw(GTK_WIDGET(glarea), NULL); > > I tried > Gtk.Widget.Draw(glarea, NULL); > but I get the following error: > expected type access to "Gtk_Widget_Record" defined at > gtk-widget.ads:226 > setup_gl.adb:88:26: found type "MyGLArea" defined at line 15 This error message is telling you that you should do: Gtk.Widget.Draw (Gtk_Widget_Record (glarea)'access, null); Note that it said "expected type access to Gtk_widget_Record"; thus you need the type conversion and access attribute. The C code has a type conversion also; apparently the C types are pointer types, while the Ada type Gtk_Widget_Record is not an access type. Learning to read error messages carefully is an important skill. Unfortuneately, it is not a skill textbooks get into, because it is highly compiler-dependent. So feel free to post here with other error messages, provided you really have tried to read it yourself. -- -- Stephe