[gtkada] Addressing external data in a GUI

Stephen Leake stephen_leake at acm.org
Mon Jun 13 14:12:57 CEST 2005


Rick Duley <30294025 at student.murdoch.edu.au> writes:

>     procedure On_Analyse60_Source_Folder_Find_Button_Clicked
>       (Object : access Gtk_Button_Record'Class)
>     is
>        Window : constant Gtk_Window :=

which Gtk_Window is visible here? It must be yours. 

>          Gtk_Window(Gtk.Button.Get_Toplevel(Widget => Object));
>     begin
>        Window.Arguments.Source_Folder :=
>           To_Unbounded_String(Source => "This is a test");
>     end On_Analyse60_Source_Folder_Find_Button_Clicked;
>
> The template for the callback was written by Glade_2.

I don't use Glade_2, but that shouldn't matter.

> Any attempt to compile  using GPS 2.1.0 (20041129) hosted on
> pentium-mingw32msv
> with GNAT GAP 1.1.0 (20041209-323) fails with:
>
> analyse60_window_pkg-callbacks.adb:110:13: no selector "Arguments" for type
> Gtk_Window_Record'Class" defined at gtk-window.ads:63
>
> Okay - it's all my fault (it always seems to be) but:
> Q.1. Where is the fault?

You are converting to type Gtk.Window.Gtk_Window, instead of to your
window type.

Part of the fault here lies with Glade; it put in a 'use' clause for
Gtk.Window. Lesson learned; delete _all_ of the "use" clauses that
Glade adds for you; they just confuse things. Add them back only in
the procedures that need them, and/or get used to using full names, at
least until you understand what's going on better. That's one of the
reasons I don't use Glade. And I still use full names most of the
time, for GtkAda code.

-- 
-- Stephe




More information about the gtkada mailing list