[gtkada] Some bugs in 2.2.0 (win32)?

T. Kurt Bond tkb at tkb.mpl.com
Tue Jul 8 18:42:53 CEST 2003


Emmanuel Briot writes:
> > type Mdi_Frame_Record is new Gtk_Window_Record with record
> >      Button2 : Button;
> >                ^^^^^^
> > 
> > It doesn't compile unless you change Button to Gtk_Button.
> 
> How is that a bug ? There is no type by the name "Button". 

The original poster's message said:
> Take a look at these generated code snippets:

I think that the original poster was talking about code generated by
gate for a glade-2 project.  If that is so, then the question is: why
does gate generate ada code that refers to a type "Button" when it
should be a "Gtk_Button"?

(It would be helpful if we had a little more context for the original
question.)

I'm not sure where this occured in the original poster's project, but
one place I've seen this happen is with toolbars.  To see it, create a
new project with glade-2 that consists of a main window that contains
a toolbar.  Add some buttons to the toolbar.  Generate the Ada source
using gate, and take a look at the generated "window1_record" type: it
looks like this:

   type Window1_Record is new Gtk_Window_Record with record
      Toolbar1 : Gtk_Toolbar;
      Button1 : Button;
      Button2 : Button;
      Button3 : Button;
   end record;

If you manually change occurances of the "Button" type to Gtk_Button
and change the corresponding initialization code in the package body
(look for the "WARNING: Unsupported widget button" comments) to
actually create the buttons and then compile the project it works
fine.

-- 
T. Kurt Bond, tkb at tkb.mpl.com




More information about the gtkada mailing list