[gtkada] runtime error

Preben Randhol randhol at pvv.org
Fri May 31 10:13:09 CEST 2002


yoann toussaint <yoann.toussaint at free.fr> wrote on 30/05/2002 (14:38) :
> yes, I forgot that, I added the call to :
> 
>        GDK.image.Gdk_New (image, Image_normal, 
> get_visual(drawing),Width, Height);
>        Gdk.Image.Get(image,win,0,0,Width,height);
> 
> but it provokes exactly the same runtime error, but I some friends who 
> works on MS windows, so I tried this updated code on windows, and all is 
> right on windows....

That doesn't mean that there isn't something wrong with your program.
Linux and Window have different ways of redendering the graphics on
screen. On Windows it may work for some strange reason, why not on
Linux.

Anyhow looking at your source:

   procedure initDraw (Drawing : in out Gtk_drawing_area) is
      W            : gdk_Window;
      Width,Height : Gint;
   begin
      W:=Get_window (drawing);
      Get_Size (W, Width, Height);
      GDK.image.Gdk_New(Main_Window.image, Image_normal, get_visual(drawing),Width, Height);
      Gdk.Image.Get(Main_Window.image,w,0,0,Width,height);
   end InitDraw;

There seems to be some bugs here. First where do the Main_Window.image
come from? The error occurs in the Gdk.Image.Get, are you sure you can
get the window in the way you have done it. I mean you are mixing Gtk
and Gdk windows here. Unfortunately I don't know much about gdk and I'm
terribly busy, could you try to find on the net some program that does
something like this in f.eks C and we could perhaps see from there how
you must do it. I don't think this is a bug in Gtkada nor Gtk at the
moment. You may also want to ask on the gtk mailing list, though they
will answer in C code.


-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 «For me, Ada95 puts back the joy in programming.»




More information about the gtkada mailing list