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,eafb0c0f59b030c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Event mechanisms for GUI's References: <3egSg.208528$1i1.141541@attbi_s72> <1159338085.495558.286500@i42g2000cwa.googlegroups.com> <7s2dnaT_9fw5nobYnZ2dnUVZ_tOdnZ2d@megapath.net> <_AHSg.210879$1i1.191702@attbi_s72> <1160853954.468627.128210@m7g2000cwm.googlegroups.com> <1160879371.648453.23540@h48g2000cwc.googlegroups.com> <1161267729.431982.31510@f16g2000cwb.googlegroups.com> In-Reply-To: <1161267729.431982.31510@f16g2000cwb.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1161289110 12.201.97.213 (Thu, 19 Oct 2006 20:18:30 GMT) NNTP-Posting-Date: Thu, 19 Oct 2006 20:18:30 GMT Date: Thu, 19 Oct 2006 20:18:30 GMT Xref: g2news2.google.com comp.lang.ada:7051 Date: 2006-10-19T20:18:30+00:00 List-Id: Lucretia wrote: > > The only way I can see of doing this (unless you want to supply some > code to illustrate) is by providing the listener idiom and separating > each listener "handler" into a separate interfaces (Ada 2005) and then > providing a Set_Events_Mask on the component which goes through the bit > mask and checks if there are interfaces set for the particular events: That seems overly complicated. Something like type Window_ID is ...; type Widget_ID is ...; type Event_ID is (Close, Left_Click, Middle_Click, Right_Click, Double_Click, ...); type Event_List is array (Positive range <>) of Event_ID; type Event_Set is private; function Make (List : Event_List) return Event_Set; procedure Add (To : in Window_ID; Event : in Event_ID); procedure Remove (From : in Window_ID; Event : in Event_ID); procedure Add (To : in Window_ID; Set : in Event_Set); procedure Remove (From : in Window_ID; Set : in Event_Set); function Event_Pending (Window : Window_ID) return Boolean; procedure Get (Event : out Event_ID; Widget : out Widget_ID); -- Jeff Carter "I fart in your general direction." Monty Python & the Holy Grail 05