[gtkada] Curious use visibility for Get_Window.

Pascal p.p14 at orange.fr
Thu Aug 4 11:26:24 CEST 2011


Hello.

In GtkAda there is lot of overloading names so I want to know who is who with a simple example (see attached file).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hello.adb
Type: application/octet-stream
Size: 2203 bytes
Desc: not available
Url : /pipermail/gtkada/attachments/20110804/75ab8a0d/attachment.obj 
-------------- next part --------------


Thus I avoid use of use clause but I've a curious behavior with GNAT GPL 2011 and GtkAda template project from GPS:

a) unmodified file
sh-3.2$ gnatmake -Phello.gpr -XLIBRARY_TYPE=static
gcc -c -g -gnatwa -gnat05 -g -I- -gnatA /Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/src/hello.adb
hello.adb:50:10: "Get_Window" is not visible
hello.adb:50:10: non-visible declaration at gtk-widget.ads:1036
hello.adb:50:10: non-visible declaration at gdk-event.ads:395
gnatmake: "/Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/src/hello.adb" compilation error

b) when I enable only "use Gtk.Widget;"
sh-3.2$ gnatmake -Phello.gpr -XLIBRARY_TYPE=static
gcc -c -g -gnatwa -gnat05 -g -I- -gnatA /Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/src/hello.adb
hello.adb:50:22: expected an access type with designated private type "Gtk_Widget_Record" defined at gtk-widget.ads:77
hello.adb:50:22: found an access type with designated type "Gtk_Drawing_Area_Record'Class" defined at gtk-drawing_area.ads:64
gnatmake: "/Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/src/hello.adb" compilation error

c) when I enable only "use Gdk.Event;"
sh-3.2$ gnatmake -Phello.gpr -XLIBRARY_TYPE=static
gcc -c -g -gnatwa -gnat05 -g -I- -gnatA /Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/src/hello.adb
hello.adb:10:09: warning: unit "Widget" is not referenced
hello.adb:50:22: expected type "Gdk_Event" defined at gdk-event.ads:229
hello.adb:50:22: found type access to "Gtk_Drawing_Area_Record'Class" defined at line 42
gnatmake: "/Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/src/hello.adb" compilation error

d) when I enable only "use Gtk.Drawing_Area;"
sh-3.2$ gnatmake -Phello.gpr -XLIBRARY_TYPE=static
gcc -c -g -gnatwa -gnat05 -g -I- -gnatA /Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/src/hello.adb
hello.adb:10:09: warning: unit "Widget" is not referenced
hello.adb:21:04: warning: variable "Area" is read but never assigned
gnatbind -I- -x /Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/obj/hello.ali
gnatlink /Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/obj/hello.ali -g /usr/local/gtk-x11-gl/lib/gtkada/static/libgtkada.a -Wl,-rpath,/usr/local/gnat-2011/lib/gcc/x86_64-apple-darwin10.2.0/4.5.3/adalib/ -L/usr/local/gtk-x11-gl/lib/gtkada/static -L/usr/local/gtk-x11-gl/lib -L/usr/X11/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpng12 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -o /Users/blady/Documents/Programmation/gtk/Essais/Hello_GPS/obj/hello

Compile ok but Get_Window is not defined in Gtk.Drawing_Area.
Where does it come from ?
Any idea ?

Thanks, Pascal.
http://blady.pagesperso-orange.fr




More information about the gtkada mailing list