comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephe.Leake@nasa.gov>
Subject: Re: Custom model in gtkada?
Date: Thu, 29 Jun 2006 13:20:49 -0400
Date: 2006-06-29T13:20:49-04:00	[thread overview]
Message-ID: <ud5cryj2m.fsf@nasa.gov> (raw)
In-Reply-To: Q5Vmg.795589$084.104972@attbi_s22

"Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org> writes:

> Stephen Leake wrote:
>> I think Gtk is the best model, although the C underpinnings make
>> things difficult sometimes. In particular, it is difficult to detect
>> some errors at compile time, that the fully Ada systems can detect. At
>> root, the C pointers are not strongly typed.
>
> I think neither callbacks nor dispatching are good models. Callbacks
> are a way to get around C's lack of concurrency, since GUIs are
> inherently concurrent. 

I disagree. I only click on one thing at a time.

I suppose lots of displays can be updated with new data
"simultaneously". But underneath, there is only one display device, so
it is not concurrent.

> Let the window manager control your code so you only have 1 thread
> of control. The result violates locality,

I'm not sure what you mean by "locality" here.

> tends to result in lots of state variables global to the callbacks,

Not in a well designed GUI framework; the window object is a parameter
to the callback; no globals.

> is unintuitive, 

Since when was anything in a computer "intuitive"? At root,
"intuition" means "innate skill, evovled in humans". Computers haven't
been around long enough for humans to co-evolve with them. 

You simply mean "unfamiliar". That is a function of time spent learning.

> and is difficult to understand.

Well, lots of people disagree.

> Dispatching is simply an attempt to model callbacks with something
> other than pointers. It has the same problems as callbacks. You can do
> something similar with generics, but it's still no improvement.

Yes, they all have similar features.

> If you were designing a windowing system from scratch for a concurrent
> language such as Ada, you'd probably have a concurrent queue of events
> for each window, with a way to control what events are reported.
> That's far more straightforward and easy to understand. 

You are saying "each window should have its own thread of control".
That's way overkill.

It's like saying "each object should have its own thread of control",
in an object oriented design, without analyzing the true concurrency.

In GWindows and GtkAda, each _thread_ has its own event queue. You can
put windows in as many threads as you need. That gives you explicit
control over the concurrency behavior. If you like, you can have one
thread per window. That will be cumbersome for most applications. It
would be possible to design a GUI system that makes that style easier.

> JEWL is an example of this, though very basic.

I have not looked at JEWL.

-- 
-- Stephe



  parent reply	other threads:[~2006-06-29 17:20 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 [this message]
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
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