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!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.176 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1151081968 12.201.97.176 (Fri, 23 Jun 2006 16:59:28 GMT) NNTP-Posting-Date: Fri, 23 Jun 2006 16:59:28 GMT Date: Fri, 23 Jun 2006 16:59:28 GMT Xref: g2news2.google.com comp.lang.ada:4931 Date: 2006-06-23T16:59:28+00:00 List-Id: 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. Let the window manager control your code so you only have 1 thread of control. The result violates locality, tends to result in lots of state variables global to the callbacks, is unintuitive, and is difficult to understand. 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. 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. JEWL is an example of this, though very basic. -- Jeff Carter "Monsieur Arthur King, who has the brain of a duck, you know." Monty Python & the Holy Grail 09