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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a3f460aaba1863e2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail From: "Lucretia" Newsgroups: comp.lang.ada Subject: Re: Private primitive operations available to entire package hierarchy. Can it be done? Date: 27 Jul 2005 10:36:00 -0700 Organization: http://groups.google.com Message-ID: <1122485760.918191.274380@f14g2000cwb.googlegroups.com> References: <1120752411.808598.292980@g49g2000cwa.googlegroups.com> <1121269243.013754.57720@g14g2000cwa.googlegroups.com> <1121883276.400592.326630@o13g2000cwo.googlegroups.com> <1122315253.757948.150350@z14g2000cwz.googlegroups.com> <8_ydncLVTeRn5njfRVn-jA@megapath.net> NNTP-Posting-Host: 194.74.199.42 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1122485766 12807 127.0.0.1 (27 Jul 2005 17:36:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 27 Jul 2005 17:36:06 +0000 (UTC) In-Reply-To: <8_ydncLVTeRn5njfRVn-jA@megapath.net> User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=194.74.199.42; posting-account=G-J9fgwAAADgpzBiEyy5tO4f8MX5fbpw Xref: g2news1.google.com comp.lang.ada:3804 Date: 2005-07-27T10:36:00-07:00 List-Id: Hmm, what I posted was a bit wrong. The event handler connect generics actually take an Event_Handler_Class which all windows are rooted at. Another example is when passing the items to sizers using "Add" after the controlling parameter the next parameter is a Window_Class (currently - it will be possible to add sizers as well in the future) which is the item to add into the sizer, this is where I've needed to use aliased. In my minimal sample I derive a new Frame_Type and within that I have declared a Button_Type instance, i.e. type Minimal_Frame_Type is new Frame_Type with record ... Button : aliased Button_Type; ... end record; Now, in the code I do this: Add(Some_Sizer, Self.Button'Unchecked_Access...); If I remove the aliased, it wont compile because Button is not aliased (it is rooted at Object_Type like all other wxAda types). If I keep aliased but use 'Access it doesn't compile because it is a local object - I have also tried allocating the Minimal_Frame_Type using new rather than having a "global" and it still requires the aliased. Because of all of this, I am seriously considering using pointers to these instances rather than just instantiating them, i.e.: type Minimal_Frame_Type is new Frame_Type with record ... Button : Button_Access; ... end record; type Minimal_Frame_Access is access all Minimal_Frame_Type; and having all primitives take an access parameter as the controlling parameter. Thanks, Luke.