comp.lang.ada
 help / color / mirror / Atom feed
* Thickening Ada GTK or Vala Binding ?
@ 2012-12-27 17:45 Patrick
  2012-12-27 19:07 ` Dmitry A. Kazakov
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Patrick @ 2012-12-27 17:45 UTC (permalink / raw)


So I am still going around in circles with the front end of my two projects. I am however learning new things with each revolution.

Now I am thinking I will not use the smaller toolkits, FLTK, Fox and Tk and will stick to WxWidgets/QT/GTK with GTK being preferred. 

I have done some experiments. QT has a method called QApplication::processEvents that was designed to be called from long running callbacks to avoid locking up the gui. I wrapped it and called it from a loop inside Ada and avoided the normal QT main loop all together. I would then be able to call tasks and use Ada’s multi-threading. I would however have to wrap each C++ callback in C in order to bind to Ada and that looked painful.

I also did some C GTK  + Ada experiments. GTK has gtk_main_iteration  but  was not able to call it without first initializing the regular main loop.  This is not actually a problem and while I have not finished the test I am confident that I could do what I was able to do with QT and make a callback that passed control to Ada and have Ada not return control but to call   gtk_main_iteration instead.

My plan was to write more C functions to hide away as much GTK complexity as possible and to bind to these functions. So for instance GTK uses glib types a lot but I don’t want to have strange looking gint types etc in Ada, not to mention access types.

This leads into what everyone must be thinking, why not just use GtkAda??

There is tons of C Gtk documentation, examples and a large community to call for help with on.

Looking at Gtk Ada in makes my head spin. C GTK is bad enough but all the mess with pointers and glib just looks that much worse in Ada. I don’t see how anyone could use it unless they had a very strong understanding of both Ada and C GTK. I am trying to catch up but right now this does not describe me.

So to the point......(thanks for reading this far)

If I was going to write c functions to hide away the GTK ugliness why don’t just write them in Ada and help the community.

Does anyone have some small code examples that might help with this ? Or tips on how I could make another wrapper around Ada GTK ?

that being said, this does not have to end up being a full reusable wrapper around GTK, it could be codes samples that other people could use. I think it is very hard to write reusable code as everyone’s needs are different. 

Also has anyone else  looked at Vala ?

https://live.gnome.org/Vala/

Vala is designed to hide away as much of C GTK as possible, it compiles to plain C. What it I wrapped Vala GTK?


Thanks-Patrick



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-02-08  6:49 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-27 17:45 Thickening Ada GTK or Vala Binding ? Patrick
2012-12-27 19:07 ` Dmitry A. Kazakov
2012-12-27 21:53   ` Patrick
2012-12-28  7:57     ` Dmitry A. Kazakov
2012-12-28 23:51       ` Randy Brukardt
2013-01-13  6:24         ` gautier_niouzes
2013-01-15  0:34           ` Randy Brukardt
2012-12-27 22:58 ` Brian Drummond
2012-12-27 23:06   ` Patrick
2012-12-28  9:53     ` Brian Drummond
2012-12-28  0:53 ` Robert Matthews
2012-12-28  1:41   ` Patrick
2012-12-28  2:03     ` Robert Matthews
2012-12-28  5:22 ` Vadim Godunko
2012-12-28  7:38   ` Vadim Godunko
2013-02-07  9:34   ` Gour
2013-02-08  6:49     ` Gour
2012-12-28 11:34 ` Justin Time
2012-12-28 23:56   ` Randy Brukardt
2013-01-11  1:40     ` Saulo
2013-01-11 12:02       ` Jacob Sparre Andersen
2013-01-11 20:14         ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox