[gtkada] Status

Stéphane LOS slos at hilscher.com
Wed Jul 3 15:18:31 CEST 2013


Le 02/07/2013 17:40, Stéphane LOS a écrit :
> Hello Mister SETTON,
>
> Le 02/07/2013 11:57, Nicolas Setton a écrit :
>> Hello,
>>
>>> I am new to GtkAda but I am quite used with gtkmm :
>>> http://slo-ist.fr/hilscher/netic-netic-test-tool
>>>
>>> I am also new to Ada and learning it through my GMGPLed project "Ada 
>>> for Automation" :
>>> http://slo-ist.fr/ada4autom
>>>
>>> Of course, I would like to have some GUI for it using GtkAda.
>>>
>>> I have sent an email which remains unanswered :
>>> http://lists.adacore.com/pipermail/gtkada/2013-June/004260.html
>>>
>>> When learning Ada, a language designed with quality in mind, one 
>>> expect the test / demo applications to just work out of the archive.
>>> So I am a little bit disappointed with my experience.
>>>
>>> As I was saying in my previous email :
>>> The glade thing does show the buttons in the toolboxes only when the 
>>> mouse flies over them, it is unusable.
>> We have fixed this in the development version. Stay tuned for future 
>> updates on <http://libre.adacore.com/tools/gtkada/>.
> Fine, will it be announced via the list ?
>
>>> The testcairo.exe works fine.
>>> The testgtk.exe does not do what it is intended to. Looking at it it 
>>> seems that it uses deprecated stuff, like in "gtkbuilder_example.xml" :
>>> <interface>
>>>   <requires lib="gtk+" version="2.14"/>
>>> <!-- interface-naming-policy toplevel-contextual -->
>>>   <object class="GtkWindow" id="window1">
>>>     <signal name="destroy" handler="on_window1_destroy"/>
>>>     <signal name="delete_event" handler="on_window1_delete_event"/>
>>>     <child>
>>>       <object class="GtkVBox" id="vbox1">
>>>>> I don't understand the above.
> In :
> E:\Ada\GtkAda\3.4.2\share\examples\gtkada\testgtk\create_builder.adb 
> or create_gtkada_builder.adb
>
> one can find :
>    Default_Filename : constant String := "gtkbuilder_example.xml";
>    --  This is the file from which we'll read our UI description.
>
> This file contains :
>  <requires lib="gtk+" version="2.14"/>
> I would expect something like "3.xx".
>
> And it seems to me that HBox and VBox are now deprecated.
>
>>
>>> When comparing what is here :
>>> http://docs.adacore.com/gtkada-docs/gtkada_rm/gtkada_rm/
>>>
>>> with :
>>> file:///E:/GNAT/2013/GtkAda/share/doc/gtkada/gtkada_rm/index.html
>>>
>>> I can see that the GtkExtra stuff is gone.
>>> I cannot find anything related in :
>>> file:///E:/GNAT/2013/GtkAda/share/doc/gtkada/gtkada_ug/index.html
>>>
>>> Could someone tell what is the status of GtkExtra ? Is it work in 
>>> progress or definitely dead ?
>> As far as I understand, GtkExtra has not yet been ported to Gtk3, so 
>> not much we can do for now.
> I understand.
>
>>
>>> I am willing to help if I can. I could try to fix some little bugs 
>>> if someone knowledgeable can drive my effort.
>>>
>>> I am not complaining. If we want people new to Ada to enjoy it we 
>>> have to iron out those nasty bugs and I want to help.
>>>
>>> Thank you to let me know if there is another attempt to this and how 
>>> we could work together.
>> We are definitely welcoming patches. A good place to start might be 
>> testgtk: feel free to give details on what you would like to 
>> contribute, and we can take it from there.
> Since I was swimming a little I have decided to bite some smaller 
> piece of code and I have started with the simplest example I could 
> find in your svn tree :
> E:\Ada\svn\examples\tutorial\helloworld
>
> It almost compile fine excepted in hello.adb (if I comment it out it 
> compiles and runs fine) :
>    Handlers.Object_Connect
>      (Button,
>       "clicked",
>       Handlers.To_Marshaller (Gtk.Widget.Destroy_Cb'Access),
>       Window);
>
> "Gtk.Widget.Destroy_Cb" does not exist. Instead there is a 
> "Gtk.Widget.Destroy".
>
> But this one gives the following result :
>> gnatmake -d 
>> -PE:\Ada\GNAT\Projects\examples\tutorial\helloworld\helloworld.gpr 
>> -XLIBRARY_TYPE=relocatable
>> gcc -c -gnat05 -I- -gnatA 
>> E:\Ada\GNAT\Projects\examples\tutorial\helloworld\src\hello.adb
>> hello.adb:78:15: no candidate interpretations match the actuals:
>> hello.adb:78:49: expected type "Handler" defined at 
>> gtk-marshallers.ads:395, instance at gtk-handlers.ads:909, instance 
>> at hello_package.ads:35
>> hello.adb:78:49: found type access to procedure "Destroy" defined at 
>> line 78
>> hello.adb:78:49:   ==> in call to "To_Marshaller" at 
>> gtk-handlers.ads:945, instance at hello_package.ads:35
>> hello.adb:78:49:   ==> in call to "To_Marshaller" at 
>> gtk-handlers.ads:940, instance at hello_package.ads:35
>> hello.adb:78:49:   ==> in call to "To_Marshaller" at 
>> gtk-handlers.ads:935, instance at hello_package.ads:35
>> hello.adb:78:49:   ==> in call to "To_Marshaller" at 
>> gtk-handlers.ads:930, instance at hello_package.ads:35
>> hello.adb:78:49:   ==> in call to "To_Marshaller" at 
>> gtk-handlers.ads:926, instance at hello_package.ads:35
>> hello.adb:78:49:   ==> in call to "To_Marshaller" at 
>> gtk-handlers.ads:922, instance at hello_package.ads:35
>> hello.adb:78:49:   ==> in call to "To_Marshaller" at 
>> gtk-handlers.ads:918, instance at hello_package.ads:35
>> hello.adb:78:49:   ==> in call to "To_Marshaller" at 
>> gtk-handlers.ads:914, instance at hello_package.ads:35
>> gnatmake: 
>> "E:\Ada\GNAT\Projects\examples\tutorial\helloworld\src\hello.adb" 
>> compilation error
>> [2013-07-02 17:36:27] process exited with status 4 (elapsed time: 
>> 01.24s)
>
> I am afraid I have to say that it is not clear to me how the handlers 
> / marshallers are working... or not.
>
> Thank you for your kind support.
>
>>
>> Best regards,
>>
>> Nicolas
>
> Best Regards,
> Cordialement,
>
> Stéphane LOS
> slos at hilscher.com
> Support technique
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Hilscher France
> 12, rue du 35ème Régiment d'Aviation
> Miniparc du Chêne
> 69500 BRON
> France
> Tél. : +33 (0) 4 72 37 98 40
> Fax  : +33 (0) 4 78 26 83 27
> http ://www.hilscher.fr
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> _______________________________________________
> gtkada mailing list
> gtkada at lists.adacore.com
> http://lists.adacore.com/mailman/listinfo/gtkada
>
Hello,

Being at it I have given a try to the other examples :

1 - E:\Ada\svn\examples\tutorial\helloworld2
Compiles and runs fine without any modification.

2 - E:\Ada\svn\examples\tutorial\simple
Compiles and runs fine without any modification.

3 - E:\Ada\svn\examples\tutorial\table
Compiles and runs fine without any modification.

4 - E:\Ada\svn\examples\tutorial\packbox
In "packbox_test.adb" it is needed to replace (line 23):
       --        Gtk.Main.Gtk_Exit (1);
       Gtk.Main.Main_Quit;
but the latter does not allow to return any status.

Also at line 243:
--           Set_Usize (Separator, 400, 5);
          Set_Size_Request (Separator, 400, 5);

5 - E:\Ada\svn\examples\tutorial\tictactoe
In "tictactoe.adb" line 45 :
--     Class_Record : GObject_Class := Uninitialized_Class;
    Class_Record : Ada_GObject_Class := Uninitialized_Class;

At line 106 :
--              Set_USize (Tictactoe.Buttons (J, K).Button, 20, 20);
             Set_Size_Request (Tictactoe.Buttons (J, K).Button, 20, 20);

I am wondering if we should use the Ada 2005 syntax which I prefer in 
all of the examples :
             Tictactoe.Buttons (J, K).Button.Set_Size_Request (20, 20);

At line 190 :
--        Main.Gtk_Exit (0);
       Main.Main_Quit;

6 - E:\Ada\svn\examples\tutorial\gtkdial
This one needs much more work since it uses Gdk.Drawable instead of 
Cairo and the TimeOut thing that has migrated to Glib.Main.

Thank you for your kind support.

Best Regards,
Cordialement,

Stéphane LOS
slos at hilscher.com
Support technique

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hilscher France
12, rue du 35ème Régiment d'Aviation
Miniparc du Chêne
69500 BRON
France
Tél. : +33 (0) 4 72 37 98 40
Fax  : +33 (0) 4 78 26 83 27
http ://www.hilscher.fr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the gtkada mailing list