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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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 Path: g2news1.google.com!postnews.google.com!e16g2000pri.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Properties Date: Thu, 2 Dec 2010 21:53:13 -0800 (PST) Organization: http://groups.google.com Message-ID: <083addb2-61f6-4a69-bb81-2e4fa640783b@e16g2000pri.googlegroups.com> References: <3b84c8e7-1a51-4a7c-9646-119f1fc51478@s4g2000yql.googlegroups.com> <4pnv7nl4cdui$.1n28i7lqk4mek$.dlg@40tude.net> <1k7367gtebsgm$.18auo6u3nfg34.dlg@40tude.net> NNTP-Posting-Host: 174.28.198.93 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1291355593 9246 127.0.0.1 (3 Dec 2010 05:53:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 3 Dec 2010 05:53:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e16g2000pri.googlegroups.com; posting-host=174.28.198.93; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729; .NET4.0E),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:15767 Date: 2010-12-02T21:53:13-08:00 List-Id: On Dec 1, 8:59=A0am, "Dmitry A. Kazakov" wrote: >The main problem is the interface of such a library. There are >multiple parallel hierarchies need to be handled: a hierarchy >of widget types, a hierarchy of widget containers, a hierarchy >of event handlers (events are filtered, propagated, swallowed, >re-generated). > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Why not have an INTERFACE hierarchy in addition to the GUI_Object hierarchy? This would allow for an easy way for foreign-language objects to be incorporated, to some extent, into applications which use this hypothetical library.... with only the added encumberment of forcing more up-front design. (Usu. a good thing.) Additionally, it could help with keeping the GUI_Object hierarchy smaller as there are many GUI items which are themselves composed of other GUI items. A scroll-bar, for example, has two distinct interfaces: the Button[s] and the slider-bar. The event-handler hierarchy seems to be the most 'interesting', not because of the events themselves, but because of the problem of how best to hook them; as you said they can be consumed, passed-through, emitted, and so-forth. They should, therefore be lightweight (as we don't want to transmit unnecessary information), quick in construction (this will impact the GUIs responsiveness) and clean in destruction (no memory leaks, please). By "widget containers" do you mean something like Ada.Containers.Vectors initialized to the classwide-type of the root of the GUI_Object hierarchy, OR do you mean some component which contains other components (like a panel, perhaps)? {I'm inclined to believe you meant the latter.} Finally, I've been quite impressed with Delphi's Visual Component Library (VCL). Microsoft's MFC and Java's JFC seem to have been 'inspired' [or copied] from the VCL, but neither presents itself as uniform & usable/mature [if you will] as the VCL. While the VCL doesn't use interfaces it does make nice use of properties; event handlers are get/set w/ properties and handlers are not required to be installed for every object like they are in Java; I believe that internally Delphi uses something like this: If Assigned(Handler) Then Handler^(Sender); {Assigned tests for null.}