comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Ada newbie!
Date: 16 Apr 2001 16:58:32 -0400
Date: 2001-04-16T21:13:30+00:00	[thread overview]
Message-ID: <u4rvoo93b.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 3ADB4F1C.AA362C9E@ida.his.se

Michael Andersson <a98mican@ida.his.se> 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



      reply	other threads:[~2001-04-16 20:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-16 19:59 Ada newbie! Michael Andersson
2001-04-16 20:58 ` Stephen Leake [this message]
replies disabled

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