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!nntp.giganews.com!bcklog1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Fri, 30 Jun 2006 17:40:28 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada 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> <6bfpg.12754$FQ1.8736@attbi_s71> Subject: Re: Custom model in gtkada? Date: Fri, 30 Jun 2006 17:41:13 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-Z35TnAgCJ2SeR120ZYLJlprPw2BbHwrR69OZ0CzCNhtn3lWyEATsP+msSRs4nm7lRjY2RgmYzwI48nN!bUS3Rz+HCNGG5X1A6oeZxuIj0VVfIpLgokbqgsxy9cB41MprCLVC3QBmO1rBPW2IHu31UXmFhFHv!F99NddUXOZMKEw== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:5359 Date: 2006-06-30T17:41:13-05:00 List-Id: "Jeffrey R. Carter" 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.