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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,36a29c2860aff686 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!newsfeed.straub-nv.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Properties Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <3b84c8e7-1a51-4a7c-9646-119f1fc51478@s4g2000yql.googlegroups.com> <4pnv7nl4cdui$.1n28i7lqk4mek$.dlg@40tude.net> <1k7367gtebsgm$.18auo6u3nfg34.dlg@40tude.net> Date: Wed, 1 Dec 2010 19:22:11 +0100 Message-ID: <1u5dftkqqi68c.10079qnqyyfwb$.dlg@40tude.net> NNTP-Posting-Date: 01 Dec 2010 19:22:10 CET NNTP-Posting-Host: b0426b51.newsspool3.arcor-online.net X-Trace: DXC=`9jE>En4D5_V;Ef1`Jk54\McF=Q^Z^V3X4Fo<]lROoRQ8kF On Wed, 1 Dec 2010 16:20:44 +0000 (UTC), Warren wrote: > Dmitry A. Kazakov expounded in > news:1k7367gtebsgm$.18auo6u3nfg34.dlg@40tude.net: > >> On Wed, 1 Dec 2010 15:21:39 +0000 (UTC), Warren wrote: >>> A library designed in Ada from the ground up, would be >>> better. >> >> But we cannot, think about a type- and task-safe >> notification mechanism. I have no idea how to do it without >> tagged tasks and protected objects. > > Perhaps the scope you have in mind is too large. Is it really > necessary to have the GUI operate outside of one task? Affirmative. Consider an oscilloscope widget indicating real-time data. Consider a debug window showing log messages from different tasks. The worst thing of GTK is that it is not task-safe. > Leave the task handling to the application designer. Obtrusive and inefficient. I did it for GtkAda. It is quite uncomfortable to use, and if you forget to route GTK requests to the main task, you get sporadic crashes difficult to trace down, quite nasty. >> And I don't want to >> instantiate a generic each time I need an event handler. > > Agreed, but I don't believe we're stuck with that solution. > All you need is procedure'Access for the callback. No, because events have parameters and those must be typed. The standard solution is that you instantiate a generic (and there is one for each number of parameters and the results). That is extremely boring. >> And I do want the compiler to check that all events are >> handled. > > Hmmm, more of a scope problem, I think. Your requirements may > be part of the problem. But otherwise you would have to frantically search for the handler that caught the event you expected the widget to propagate, just to learn that the widget does not propagate it at all. Even better if you create an events generator that covers all desktop with multiplying pop-up windows. I hate this stuff. >> At least >> the first and the third must be statically checked, if we >> really want it be Ada. > > Callbacks (events) are dynamic by nature. I think the best you > can hope for is that your event handler is the correct kind > (of callback) and that any parameters match are of the correct > type. Both areas that Ada excells at. > > Asking for more than that, is perhaps a requirements problem. Maybe, but I expect excellence from a standard library. >> Very likely that some composite >> widgets (the second hierarchy) should also be static. > > I think tagged records are going to be the only real solution > here, which is going to forgo static analysis. Yes, this is my impression too. > I think a tagged solution is at least as good as a C++ > solution, but better due to Ada strengths. I think many folks > could live with the dynamic nature of an Ada GUI library. BTW, most likely multiple inheritance will be needed. There is a huge resistance to MI in Ada. I have no idea why, nobody managed to articulate anything but prejudices and urban legends. > It really comes down to what is "good enough" for a standard > GUI library. Your requirements are desirable, but with > existing software technologies, it doesn't appear practical > AFAICS. They are practical at least in pushing Ada into a right direction. (I guess, the reason why I agree with Randy most of the time is because he maintains CLAW and I do the GtkAda contributions. This keeps us on the same page.) > Are there any GUI systems implemented that are fully static > checked? I guess no. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de