From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,37023471dc2e1934 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c08.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Custom model in gtkada? References: <3ndpd7br1nn9$.vkcrts8e898z.dlg@40tude.net> <20060614210028.GA18024@ws.max.zp.ua> <44917d39$0$4495$9b4e6d93@newsread2.arcor-online.net> <44941be9$0$11065$9b4e6d93@newsread4.arcor-online.net> <14e2r2ftir9ok.i8u1axnplx11.dlg@40tude.net> <449a432e$0$15869$bb6a4dc3@news.uunet.fr> From: Stephen Leake Date: Thu, 29 Jun 2006 13:20:49 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:tIdv5aQ6mYRC2AU0lGRddZt88UQ= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 3b80244a40bfd696e944526275 Xref: g2news2.google.com comp.lang.ada:5299 Date: 2006-06-29T13:20:49-04:00 List-Id: "Jeffrey R. Carter" 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