comp.lang.ada
 help / color / mirror / Atom feed
* Ada newbie!
@ 2001-04-16 19:59 Michael Andersson
  2001-04-16 20:58 ` Stephen Leake
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Andersson @ 2001-04-16 19:59 UTC (permalink / raw)


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


Need your help please!
/Micke




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

* Re: Ada newbie!
  2001-04-16 19:59 Ada newbie! Michael Andersson
@ 2001-04-16 20:58 ` Stephen Leake
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Leake @ 2001-04-16 20:58 UTC (permalink / raw)


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



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

end of thread, other threads:[~2001-04-16 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-16 19:59 Ada newbie! Michael Andersson
2001-04-16 20:58 ` Stephen Leake

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