comp.lang.ada
 help / color / mirror / Atom feed
From: "Lucretia" <lucretia9@lycos.co.uk>
Subject: Re: Private primitive operations available to entire package hierarchy. Can it be done?
Date: 27 Jul 2005 10:36:00 -0700
Date: 2005-07-27T10:36:00-07:00	[thread overview]
Message-ID: <1122485760.918191.274380@f14g2000cwb.googlegroups.com> (raw)
In-Reply-To: <8_ydncLVTeRn5njfRVn-jA@megapath.net>

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.




  reply	other threads:[~2005-07-27 17:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-07 16:06 Private primitive operations available to entire package hierarchy. Can it be done? Lucretia
2005-07-07 16:17 ` OT: Joke Adrien Plisson
2005-07-07 16:24   ` Matthew Heaney
2005-07-07 19:10 ` Private primitive operations available to entire package hierarchy. Can it be done? Randy Brukardt
2005-07-13 15:40   ` Lucretia
2005-07-19 23:19     ` Randy Brukardt
2005-07-20 18:14       ` Lucretia
2005-07-21  3:10         ` Randy Brukardt
2005-07-25 18:14           ` Lucretia
2005-07-25 23:58             ` Randy Brukardt
2005-07-27 17:36               ` Lucretia [this message]
2005-07-27 21:28                 ` Randy Brukardt
2005-07-28 10:09                   ` Lucretia
2005-07-29  0:40                     ` Randy Brukardt
2005-08-02 15:55                       ` Lucretia
2005-08-03 18:26                         ` Lucretia
2005-08-03 20:04                           ` Randy Brukardt
2005-08-03 20:03                         ` Randy Brukardt
2005-08-08 18:04                           ` Lucretia
2005-08-08 20:47                             ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox