comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Custom model in gtkada?
Date: Fri, 30 Jun 2006 17:41:13 -0500
Date: 2006-06-30T17:41:13-05:00	[thread overview]
Message-ID: <u4WdnWzek47BNTjZnZ2dnUVZ_vadnZ2d@megapath.net> (raw)
In-Reply-To: 6bfpg.12754$FQ1.8736@attbi_s71

"Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org> wrote in message
news:6bfpg.12754$FQ1.8736@attbi_s71...
...
> I'm talking about the use of the system, not the details of how it's
> implemented. In the event-queue model, the client code obtains events
> from an event queue and responds to them; in the callback model the
> client associates events with subprograms it provides to the windowing
> system, yields control to the windowing system, and the windowing system
> calls the provided subprograms when it decides such calls are appropriate.
>
> Say, even the description of the event-queue model is simpler than the
> description of the callback model.

That's surely true, but the problem with event-queues (at least in
real-world implementations like Windows and Mac) is that all of the possible
events come to one place. Windows has more than 800 events in its core, and
many more in the subsidiary packages. The whole reason for using tagged type
dispatching is to manage the complexity that comes from that: only sending
relevant events to the objects that care about them.

You could write such an infastructure yourself, but you will end up with
giant case statements handling and distributing events -- and the net effect
is pretty much the same as with a GUI framework, except now you have more
code to maintain.

I could imagine a hybrid framework that gave each window object its own
event queue, but then you'd need a thread of control for each object in
order that it be responsive (for instance, to a click that's intended to
bring a lower window to the top). [Or a very complex control structure.]

The truth is that GUIs are very complex beasts, and nothing is going to make
programming them simple (unless you needs are very basic [This is where JEWL
aims]). The tagged type/action handler works as well as any (it's even
better in Ada 2005 with the nesting limitations removed).

                               Randy Brukardt.





  reply	other threads:[~2006-06-30 22:41 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13 18:01 Custom model in gtkada? Dmitry A. Kazakov
2006-06-13 19:53 ` M E Leypold
2006-06-14  7:17   ` Dmitry A. Kazakov
2006-06-14 21:00 ` Maxim Reznik
2006-06-15  7:38   ` Dmitry A. Kazakov
2006-06-15 15:31     ` Georg Bauhaus
2006-06-15 16:24       ` Ed Falis
2006-06-15 18:44         ` M E Leypold
2006-06-15 16:25       ` Dmitry A. Kazakov
2006-06-17 15:13         ` Georg Bauhaus
2006-06-17 16:44           ` Dmitry A. Kazakov
2006-06-22  7:16             ` Emmanuel Briot
2006-06-22  8:31               ` Dmitry A. Kazakov
2006-06-22 12:08                 ` Emmanuel Briot
2006-06-23 12:32                 ` Stephen Leake
2006-06-23 13:58                   ` Dmitry A. Kazakov
2006-06-29 17:11                     ` Stephen Leake
2006-06-30 12:29                       ` Dmitry A. Kazakov
2006-07-02 15:17                         ` Stephen Leake
2006-07-03 18:23                           ` Dmitry A. Kazakov
2006-07-04 13:51                             ` Stephen Leake
2006-07-05 13:06                               ` Dmitry A. Kazakov
2006-07-06  7:10                                 ` Stephen Leake
2006-06-23 16:59                   ` Jeffrey R. Carter
2006-06-23 17:37                     ` Ed Falis
2006-06-23 18:11                     ` Dmitry A. Kazakov
2006-06-29 17:20                     ` Stephen Leake
2006-06-29 20:08                       ` Jeffrey R. Carter
2006-06-30 10:28                         ` Alex R. Mosteo
2006-06-30 16:07                         ` Stephen Leake
2006-06-30 19:45                           ` Jeffrey R. Carter
2006-06-30 22:41                             ` Randy Brukardt [this message]
2006-07-01  5:11                               ` Jeffrey R. Carter
replies disabled

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