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

* Re: Thickening Ada GTK or Vala Binding ?
  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-27 22:58 ` Brian Drummond
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Dmitry A. Kazakov @ 2012-12-27 19:07 UTC (permalink / raw)


On Thu, 27 Dec 2012 09:45:40 -0800 (PST), Patrick wrote:

> My plan was to write more C functions to hide away as much GTK complexity
> as possible and to bind to these functions.

Won't work. C API of Gtk are more complex than GtkAda API.

> 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.

Glib is essential to Gtk. You cannot write anything more or less elaborated
without using GObject, GValue, GList etc.

GInt is the type used by Gtk for signed integers. Access types are used
because Gtk does. Remember Gtk is in C. C does not have arrays and cannot
return anything on the stack except from scalar types. GtkAda just follows
C, simplifying it where possible. E.g. Get_Text returns String rather than
the mess the native C API does (e.g. gtk_entry_get_text). As I said, GtkAda
is simpler than C API.

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

You have to learn Gtk in order to be able to use it. Once you did, the
problems you have now would simply disappear (and others, real problems
would appear in their place)

> I donοΏ½t see how anyone could use it unless they had a very strong
> understanding of both Ada and C GTK.

Learning Gtk is an absolute requirement.

> 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.

1. Nobody needs that. For people who know Gtk these would be useless. 

2. It would be impossible to design because if you know Gtk you cannot
understand the logic and difficulties of somebody who does not know it.

If you start writing the stuff, you will drop it once you gain enough
knowledge of Gtk, to see all pointlessness of the task.
 
> Does anyone have some small code examples that might help with this?

Small Gtk code examples can be found in rosetta code. But, honestly, there
is only one example needed: a window with one button. The rest is concrete
Gtk widgets and objects which are learnt by doing.

> Or tips on how I could make another wrapper around Ada GTK ?

By calling Ada subprogram from another Ada subprogram, I suppose.

Why anybody would need Ada wrappers around Ada?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-27 19:07 ` Dmitry A. Kazakov
@ 2012-12-27 21:53   ` Patrick
  2012-12-28  7:57     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 22+ messages in thread
From: Patrick @ 2012-12-27 21:53 UTC (permalink / raw)
  Cc: mailbox

"Glib is essential to Gtk. You cannot write anything more or less elaborated
without using GObject, GValue, GList etc. "

You really should look at Vala then.

"You have to learn Gtk in order to be able to use it. Once you did, the
problems you have now would simply disappear (and others, real problems
would appear in their place) "

Actually I can program just fine with C GTK. I can also eat worms fine too. I just don't want to

"Won't work. C API of Gtk are more complex than GtkAda API. "

Looking at your online resume, I can say you are uniquely unqualified to make this statement. You have more then 20 years, full time, experience as a programer. After rereading messages from the list, it appears that many of those years were with Ada. What is obvious to you is not to others. I have 8 years part time and understand what Ada GTK feels like to someone new to Ada as I only have a little over a year with it.

Programming GTK using dynamic bindings is super simple, PyGtk is particularly easy. C is also fairly easy but it's like eating worms. Vala takes the worms, mixes it with beef and bun and gives a MacGTK option. It's not perfect but it's much easier to look at then C.

I have learned over 15 languages now(to vastly varying degrees) because I can't stand looking at C, I just hate it and am willing to work twice as hard if I don't have to look at it.

I would love to be able to do what Vala has done for people who like the C family languages but for the Ada community. I will continue to struggle and learn by myself if needed and share later.

Ada should not only be for journeymen programmers, it has a lot to offer to everyone, I think the community needs more people working to lower the very high barrier to accomplishing something with it on the desktop.



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-27 17:45 Thickening Ada GTK or Vala Binding ? Patrick
  2012-12-27 19:07 ` Dmitry A. Kazakov
@ 2012-12-27 22:58 ` Brian Drummond
  2012-12-27 23:06   ` Patrick
  2012-12-28  0:53 ` Robert Matthews
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Brian Drummond @ 2012-12-27 22:58 UTC (permalink / raw)


On Thu, 27 Dec 2012 09:45:40 -0800, Patrick wrote:

> 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.
> 
>  I would however have to wrap each C++ callback in C in
> order to bind to Ada and that looked painful.

Why would you have to? It is possible to bind C++ directly to Ada. It's 
not quite as pretty because the import pragmas have to specify the C++ 
mangled name (they translate from a sensible name) but 
"gcc -fdump-ada-spec myheader.hpp" does most of the work for you.

- Brian



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-27 22:58 ` Brian Drummond
@ 2012-12-27 23:06   ` Patrick
  2012-12-28  9:53     ` Brian Drummond
  0 siblings, 1 reply; 22+ messages in thread
From: Patrick @ 2012-12-27 23:06 UTC (permalink / raw)


Hi Brian

I guess I should not have said "have to", I heard that the C++ fdump tool was experimenetal, so I was afraid to use it.

Thanks for posting



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-27 17:45 Thickening Ada GTK or Vala Binding ? Patrick
  2012-12-27 19:07 ` Dmitry A. Kazakov
  2012-12-27 22:58 ` Brian Drummond
@ 2012-12-28  0:53 ` Robert Matthews
  2012-12-28  1:41   ` Patrick
  2012-12-28  5:22 ` Vadim Godunko
  2012-12-28 11:34 ` Justin Time
  4 siblings, 1 reply; 22+ messages in thread
From: Robert Matthews @ 2012-12-28  0:53 UTC (permalink / raw)


Patrick wrote:

> 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.

I encountered a similar problem with GtkAda - rather low level
and the marshalling stuff needed careful study each time I came
back to the package.

So I started writing "Simple_Gtk", code available here:
http://www.ramatthews.free-online.co.uk/

I haven't worked on it for a few months so have not tried
it with the latest GNAT - and so have not used the latest
Ada way of interfacing to C code. However it worked (it
includes test code) and covers a number of the widgets.
Perhaps it will give you some ideas.

Robert.




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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-28  0:53 ` Robert Matthews
@ 2012-12-28  1:41   ` Patrick
  2012-12-28  2:03     ` Robert Matthews
  0 siblings, 1 reply; 22+ messages in thread
From: Patrick @ 2012-12-28  1:41 UTC (permalink / raw)


Hi Robert

This is exactly the sort of thing I was hoping to write but you did it for me! Thanks so much for sharing your code with everyone. It even has a simple sqlite3 binding :)

I am working through the code and having a little trouble as my archeture is 64 bits.

I have been changing the _library files from  /usr/lib/386-linuxi-gnu" to   /usr/lib/x86_64-linux-gnu and making progress. I noticed:

 Library_Name use "gtk-3"; in some of the gpr files. I am on debain stable and don't have gtk3 dev files installed I am guessing I will need them.

I will keeping working on this, thanks so much again for sharing !

-Patrick



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-28  1:41   ` Patrick
@ 2012-12-28  2:03     ` Robert Matthews
  0 siblings, 0 replies; 22+ messages in thread
From: Robert Matthews @ 2012-12-28  2:03 UTC (permalink / raw)


Patrick wrote:

> Hi Robert
> 
> This is exactly the sort of thing I was hoping to write but you did it for
> me! Thanks so much for sharing your code with everyone. It even has a
> simple sqlite3 binding :)
> 
> I am working through the code and having a little trouble as my archeture
> is 64 bits.
> 
> I have been changing the _library files from  /usr/lib/386-linuxi-gnu" to 
>  /usr/lib/x86_64-linux-gnu and making progress. I noticed:
> 
>  Library_Name use "gtk-3"; in some of the gpr files. I am on debain stable
>  and don't have gtk3 dev files installed I am guessing I will need them.
> 
> I will keeping working on this, thanks so much again for sharing !
> 
> -Patrick

Glad to help.

As I am now on 64-bit, perhaps you could share the results of your efforts.

I think I used some Gtk3 features so you probably do need those dev files.

Robert.




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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-27 17:45 Thickening Ada GTK or Vala Binding ? Patrick
                   ` (2 preceding siblings ...)
  2012-12-28  0:53 ` Robert Matthews
@ 2012-12-28  5:22 ` Vadim Godunko
  2012-12-28  7:38   ` Vadim Godunko
  2013-02-07  9:34   ` Gour
  2012-12-28 11:34 ` Justin Time
  4 siblings, 2 replies; 22+ messages in thread
From: Vadim Godunko @ 2012-12-28  5:22 UTC (permalink / raw)


On Thursday, December 27, 2012 9:45:40 PM UTC+4, Patrick wrote:
> 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.
> 
Your life will be much more simple if you will use QtAda: it do all low level stuff for you. You don't need to write any C/C++ at all.



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-28  5:22 ` Vadim Godunko
@ 2012-12-28  7:38   ` Vadim Godunko
  2013-02-07  9:34   ` Gour
  1 sibling, 0 replies; 22+ messages in thread
From: Vadim Godunko @ 2012-12-28  7:38 UTC (permalink / raw)


On Friday, December 28, 2012 9:22:20 AM UTC+4, Vadim Godunko wrote:
> 
> Your life will be much more simple if you will use QtAda: it do all low level stuff for you. You don't need to write any C/C++ at all.

And, you don't need to implement own event loop, Qt provides special kind of 'standard' signal-slot connections when signal is propagated from one thread to the slot of object in event main loop thread. Internal implementation is not easy, but it looks like typical Qt's signal-slot interaction.



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-27 21:53   ` Patrick
@ 2012-12-28  7:57     ` Dmitry A. Kazakov
  2012-12-28 23:51       ` Randy Brukardt
  0 siblings, 1 reply; 22+ messages in thread
From: Dmitry A. Kazakov @ 2012-12-28  7:57 UTC (permalink / raw)


On Thu, 27 Dec 2012 13:53:27 -0800 (PST), Patrick wrote:

> "Glib is essential to Gtk. You cannot write anything more or less elaborated
> without using GObject, GValue, GList etc. "
> 
> You really should look at Vala then.

AFAIK, Vala is a kind of yet-another-curly-braces programming language...

> Actually I can program just fine with C GTK. I can also eat worms fine
> too. I just don't want to

Ada bindings cannot improve Gtk, I mean sufficiently. You cannot change the
architecture of Gtk. Granted, GtkAda could use controlled handles instead
of pointers hiding the ugly way reference counting is done in Glib. Signal
handlers could use Ada 2005 interfaces rather than being generic instances,
but still ... breaded worms are worms...

> Programming GTK using dynamic bindings is super simple, PyGtk is
> particularly easy. C is also fairly easy but it's like eating worms.

What is wrong with thin bindings then? If C is "fairly easy" then thin
bindings should be OK. (GtkAda is rather middle-level)

> I would love to be able to do what Vala has done for people who like the C
> family languages but for the Ada community.

Hmm, to my limited understanding Vala represents GObject classes at the
language level. GObject is poor man's OO, because C is not an OOPL. Vala is
supposed to be an OOPL. If so, GtkAda already did all that. Each Gtk class
has a corresponding Ada class (T'Class), each Gtk object has a tagged Ada
counterpart. Hierarchy of GObject classes is mapped onto a hierarchy of
tagged Ada types.

> Ada should not only be for journeymen programmers, it has a lot to offer
> to everyone, I think the community needs more people working to lower the
> very high barrier to accomplishing something with it on the desktop.

I don't believe that bindings to any GUI framework (Gtk, Qt, Win32 etc)
could be improved to achieve that.

But if you have concrete proposals the maintainers would certainly like to
hear them.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-27 23:06   ` Patrick
@ 2012-12-28  9:53     ` Brian Drummond
  0 siblings, 0 replies; 22+ messages in thread
From: Brian Drummond @ 2012-12-28  9:53 UTC (permalink / raw)


On Thu, 27 Dec 2012 15:06:50 -0800, Patrick wrote:

> Hi Brian
> 
> I guess I should not have said "have to", I heard that the C++ fdump
> tool was experimenetal, so I was afraid to use it.

There may still be things it can't handle - C++ templates gave it some 
trouble last time I looked - but it is certainly good enough to be useful 
in most cases, and easy to try.

- Brian



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-27 17:45 Thickening Ada GTK or Vala Binding ? Patrick
                   ` (3 preceding siblings ...)
  2012-12-28  5:22 ` Vadim Godunko
@ 2012-12-28 11:34 ` Justin Time
  2012-12-28 23:56   ` Randy Brukardt
  4 siblings, 1 reply; 22+ messages in thread
From: Justin Time @ 2012-12-28 11:34 UTC (permalink / raw)


My personnal experience with GtkAda to design small applications has lead me to use glade3.8.
With glade, you design the user interface with a graphical tool and you get an XML file. glade is rather intuitive and you don't need much time to get used to it.
After this first step, you have to code the callbacks for each signal.
I think that Simple_GTK is just re-inventing the wheel, because in many cases, you will handle complex widgets like Treeviews and have to go back to plain GTKAda.
The difficult point for me is to mix multi-tasking with GTK that is not thread-safe. Neither Vala not Simple_Gtk will do the job for you. 






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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-28  7:57     ` Dmitry A. Kazakov
@ 2012-12-28 23:51       ` Randy Brukardt
  2013-01-13  6:24         ` gautier_niouzes
  0 siblings, 1 reply; 22+ messages in thread
From: Randy Brukardt @ 2012-12-28 23:51 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:13mq4q166dvto.18m38jiqi1pv3$.dlg@40tude.net...
> On Thu, 27 Dec 2012 13:53:27 -0800 (PST), Patrick wrote:
...
>> Ada should not only be for journeymen programmers, it has a lot to offer
>> to everyone, I think the community needs more people working to lower the
>> very high barrier to accomplishing something with it on the desktop.
>
> I don't believe that bindings to any GUI framework (Gtk, Qt, Win32 etc)
> could be improved to achieve that.

I reluctantly have to agree with Dmitry. We tried to hide all of the warts 
of Win32 with Claw, but that mainly made a different set of warts. I rather 
doubt it is possible to hide everything mainly because the event-driven 
model of programming simply does not mesh that well with "classical" 
sequential code (and the same is true for object-oriented code). And it's 
pretty much impossible to completely eliminate the event-driven nature of a 
GUI. (That's especially true for "modeless" windows/dialogs.)

If someone knows how to pull it off, that's great. But I won't believe it 
until I see it.

                                          Randy.





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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-28 11:34 ` Justin Time
@ 2012-12-28 23:56   ` Randy Brukardt
  2013-01-11  1:40     ` Saulo
  0 siblings, 1 reply; 22+ messages in thread
From: Randy Brukardt @ 2012-12-28 23:56 UTC (permalink / raw)


"Justin Time" <francois_fabien@hotmail.com> wrote in message 
news:7a2f4daa-b7b6-4afd-980d-be28a19735cd@googlegroups.com...
...
> The difficult point for me is to mix multi-tasking with GTK that is not 
> thread-safe. Neither Vala not Simple_Gtk will do the job for you.

That was the difficult part of designing Claw, as we did make Claw safe for 
multi-tasking in the same way that the predefined Ada libraries are (Claw 
routines are reenterant so long as the objects passed are "not 
overlapping" - we have example programs which show tasks writing into 
separate windows or controls simultaneously). You wouldn't have had to spend 
much effort to mix multi-tasking with Claw (although call-backs can't be 
blocking, so there is some problem with communicating between tasks). Of 
course, Claw is only for Windows (at least right now).

                                         Randy/ 





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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-28 23:56   ` Randy Brukardt
@ 2013-01-11  1:40     ` Saulo
  2013-01-11 12:02       ` Jacob Sparre Andersen
  0 siblings, 1 reply; 22+ messages in thread
From: Saulo @ 2013-01-11  1:40 UTC (permalink / raw)


Can I build GTK3 apps with GtkAda? If not, there will be a GtkAada port to use Gtk3?

I am not sure but I think Gtk2 will not be supported for a long time...

thx,
sauLo



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

* Re: Thickening Ada GTK or Vala Binding ?
  2013-01-11  1:40     ` Saulo
@ 2013-01-11 12:02       ` Jacob Sparre Andersen
  2013-01-11 20:14         ` Dmitry A. Kazakov
  0 siblings, 1 reply; 22+ messages in thread
From: Jacob Sparre Andersen @ 2013-01-11 12:02 UTC (permalink / raw)


Saulo wrote:

> Can I build GTK3 apps with GtkAda?

Not yet.

> If not, there will be a GtkAda port to use Gtk3?

Yes.  (That is at least the information you get from reading the GtkAda
mailing-list.)

Greetings,

Jacob
-- 
"Universities are not part of the nation's security organisation,
 they are not the nation's research laboratory either: they are
 the nation's universities."                     -- E.W. Dijkstra



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

* Re: Thickening Ada GTK or Vala Binding ?
  2013-01-11 12:02       ` Jacob Sparre Andersen
@ 2013-01-11 20:14         ` Dmitry A. Kazakov
  0 siblings, 0 replies; 22+ messages in thread
From: Dmitry A. Kazakov @ 2013-01-11 20:14 UTC (permalink / raw)


On Fri, 11 Jan 2013 13:02:57 +0100, Jacob Sparre Andersen wrote:

> Saulo wrote:
> 
>> Can I build GTK3 apps with GtkAda?
> 
> Not yet.
> 
>> If not, there will be a GtkAda port to use Gtk3?
> 
> Yes.  (That is at least the information you get from reading the GtkAda
> mailing-list.)

There is still no official GTK3 Win32 port, AFAIK. Nothing is heard about
Win64 port.

It looks that GTK2 will stay with us for a while.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: Thickening Ada GTK or Vala Binding ?
  2012-12-28 23:51       ` Randy Brukardt
@ 2013-01-13  6:24         ` gautier_niouzes
  2013-01-15  0:34           ` Randy Brukardt
  0 siblings, 1 reply; 22+ messages in thread
From: gautier_niouzes @ 2013-01-13  6:24 UTC (permalink / raw)


Le samedi 29 décembre 2012 00:51:24 UTC+1, Randy Brukardt a écrit :
> 
> I reluctantly have to agree with Dmitry. We tried to hide all of the warts 
> of Win32 with Claw, but that mainly made a different set of warts. I rather 
> doubt it is possible to hide everything mainly because the event-driven 
> model of programming simply does not mesh that well with "classical" 
> sequential code (and the same is true for object-oriented code). And it's 
> pretty much impossible to completely eliminate the event-driven nature of a 
> GUI. (That's especially true for "modeless" windows/dialogs.)
> 
> If someone knows how to pull it off, that's great. But I won't believe it 
> until I see it.
> 
>                                           Randy.

AZip ( http://azip.sf.net ) and TeXCAD ( http://texcad.sf.net ) are complete Windows applications, both even multi-document, and you won't find any event message processing in their sources.
Is it an evidence for you ? 
NB: the GUI framework is GWindows...
Cheers
_________________________
Gautier's Ada programming
http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a valid e-mail address



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

* Re: Thickening Ada GTK or Vala Binding ?
  2013-01-13  6:24         ` gautier_niouzes
@ 2013-01-15  0:34           ` Randy Brukardt
  0 siblings, 0 replies; 22+ messages in thread
From: Randy Brukardt @ 2013-01-15  0:34 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2522 bytes --]

<gautier_niouzes@hotmail.com> wrote in message 
news:ddd5b5f2-7bb3-4e34-a232-cfdebea07e41@googlegroups.com...
Le samedi 29 d�cembre 2012 00:51:24 UTC+1, Randy Brukardt a �crit :
>>
>> I reluctantly have to agree with Dmitry. We tried to hide all of the 
>> warts
>> of Win32 with Claw, but that mainly made a different set of warts. I 
>> rather
>> doubt it is possible to hide everything mainly because the event-driven
>> model of programming simply does not mesh that well with "classical"
>> sequential code (and the same is true for object-oriented code). And it's
>> pretty much impossible to completely eliminate the event-driven nature of 
>> a
>> GUI. (That's especially true for "modeless" windows/dialogs.)
>>
>> If someone knows how to pull it off, that's great. But I won't believe it
>> until I see it.
>
>AZip ( http://azip.sf.net ) and TeXCAD ( http://texcad.sf.net ) are 
>complete
>Windows applications, both even multi-document, and you won't find any 
>event
>message processing in their sources.
>Is it an evidence for you ?
>NB: the GUI framework is GWindows...

GWindows is essentially the same design as Claw, so of course it requires a 
lot of event processing. You're right that there probably isn't any raw 
event messaging processing (there isn't any need for most Claw programs 
either), but there are still lots of events (When_handlers in Claw 
terminology, these are overridden routines that handle events). I was 
talking about events in general, not "message" processing specifically. For 
instance, you have to have some sort of event handler in order to respond to 
the selection of a menu entry.

GWindows supports using access-to-subprogram routines for this, as well as 
the overridden routines of Claw. But clearly either of them is an event 
handler (not necessarily directly corresponding to a message, so they might 
not be "message handlers").

The only realistic exception to requiring event handlers is to use some sort 
of case structure. Besides being less safe (it's easy to forget to handle 
something required), it's also very limiting, because you can only handle 
specific kinds of event this way (and only ones the framework knows about). 
That is, you could handle menu events with a case structure (Claw provides 
something like this), but then you can't handle keyboard input or mouse 
actions or data validations or whatever. That makes it a very limiting 
solution, and it definitely can't be the only one.

                                       Randy.






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

* Re: Thickening Ada GTK or Vala Binding ?
  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
  1 sibling, 1 reply; 22+ messages in thread
From: Gour @ 2013-02-07  9:34 UTC (permalink / raw)


Vadim Godunko <vgodunko@gmail.com> writes:

Hello Vadim,

> Your life will be much more simple if you will use QtAda: it do all
> low level stuff for you. You don't need to write any C/C++ at all.

I'm in a position simalr to Patrick's...desiring to write multi-platform
GUI app and do not want to do it in C(++).

In the past tried with Haskell, but it was a bit weird for me doing all
IO within monad.

Considered D, but it's not stable language and GTK+ bindings are one-man
show.

Recently, for some time, considered OCaml, but although the language is
nice, it seems that we'll end with similar troubles as with Haskell due
to impdedance mismatch between FP functional code and toolkit's OOP
orientation which, makes, again, Ada, potential candidate.

So, based on your statement above, I wonder what are you plans in regard
to Qt5?


Sincerely,
Gour

-- 
As a lamp in a windless place does not waver, so the transcendentalist, 
whose mind is controlled, remains always steady in his meditation on the 
transcendent self.




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

* Re: Thickening Ada GTK or Vala Binding ?
  2013-02-07  9:34   ` Gour
@ 2013-02-08  6:49     ` Gour
  0 siblings, 0 replies; 22+ messages in thread
From: Gour @ 2013-02-08  6:49 UTC (permalink / raw)


Gour <gour@atmarama.net> writes:

> So, based on your statement above, I wonder what are you plans in regard
> to Qt5?

Excuse me...very soon after posting I found the answer in mailing list
archive.

> Sincerely,
> Gour

--  
Just try to learn the truth by approaching a spiritual master. 
Inquire from him submissively and render service unto him. 
The self-realized souls can impart knowledge unto you because 
they have seen the truth.
http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810



^ 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