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!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: Fri, 23 Jun 2006 08:32:45 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:wl7MoCuNOG2Nl1y3jo3skuSffHU= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 7cdfb449bdf7ce73ae4a428119 Xref: g2news2.google.com comp.lang.ada:4922 Date: 2006-06-23T08:32:45-04:00 List-Id: "Dmitry A. Kazakov" writes: > On Thu, 22 Jun 2006 09:16:22 +0200, Emmanuel Briot wrote: > >> Dmitry A. Kazakov wrote: >>> I would expect callbacks be primitive operations of a tagged type rather >>> than pointers. >> >> This is of course a design choice, and you can easily implement a small >> layer on top of GtkAda to do just that. >> The advantage with pointers is that you can add or remove callbacks during >> the life of a widget, which is harder to do with primitive operations where >> you need flags to know whether to react to the event or not. Also you can >> have multiple callbacks on the same signal, which, again, is harder to do >> with primitive operations. > > Maybe, though I doubt that events were a right design decision (as a > notification mechanism). How many GUI programs have you written? With how many different toolkits? I've used Visual Basic (essentially tagged, I think :), Borland's C++ framework (tagged/dispatching), Windex (Ada tagged), GWindows (mixed tagged/pointers), and Gtk (pointers). 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. > Another point, a list of pointers to subprograms is in no way better than a > list of tagged objects (with primitive subprograms). Why? I would find a list of tagged objects confusing. -- -- Stephe