[gtkada] help on a draw program
User MARTIN
martin at info.unilim.fr
Fri Apr 2 18:52:33 CEST 2004
hi all i try to learn how to use gtkada to make some draw i have make a
litle program who use the code for draw found in the gtkada RM
and a bit of code of myself but...
no luck not working and as i'm a begginer in gtkada i have spend a nice
day trying to make it work.
so i send all the stuff here , and i hope that someone can take the time
to either explain me the matter or send me a link to a simple gtkada
program who use draw.
the code is :
with Gtk.Main, Gtk.Window, Draw, Gtk.Drawing_Area, Gtk.Widget,
Gtk.Handlers;
with Ada.Text_IO;
use Gtk.Widget;
procedure dessintest is
Window : Gtk.Window.Gtk_Window;
Drawing_Area : Gtk.Drawing_Area.Gtk_Drawing_Area;
begin
Gtk.Main.Init;
Gtk.Window.Gtk_New (Window);
Gtk.Drawing_Area.Gtk_New (Drawing_Area);
Gtk.Window.Add(Window, Drawing_Area);
-- Handlers.Connect (Drawing_Area, "expose_event",
Handlers.To_Marshaller (Expose_Event'Access));
Draw(Drawing_Area);
Gtk.Drawing_area.Show(Drawing_Area);
Gtk.Window.Show (Window);
Gtk.Main.Main;
end dessintest;
after compil i get :
Gdk-CRITICAL **: file gdkwindow.c: line 929 (gdk_window_clear): assertion
`window != NULL' failed.
Gdk-CRITICAL **: file gdkgc.c: line 51 (gdk_gc_new_with_values): assertion
`window != NULL' failed.
Gdk-CRITICAL **: file gdkdraw.c: line 65 (gdk_draw_line): assertion
`drawable != NULL' failed.
Gdk-CRITICAL **: file gdkdraw.c: line 124 (gdk_draw_arc): assertion
`drawable != NULL' failed.
Gdk-CRITICAL **: file gdkdraw.c: line 268 (gdk_draw_text): assertion
`drawable != NULL' failed.
Gdk-CRITICAL **: file gdkgc.c: line 288 (gdk_gc_unref): assertion `gc !=
NULL' failed.
the draw function can be found at:
http://libre.act-europe.fr/GtkAda/docs/gtkada_rm_30.html#SEC115
thanks all if u can spend a litle time on that or even giving me some
way to understood what this don't works.
More information about the gtkada
mailing list