comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: access to subprogram disciminants
Date: 1996/04/27
Date: 1996-04-27T00:00:00+00:00	[thread overview]
Message-ID: <4lrriv$as3@news1.delphi.com> (raw)


  main_window : frame_windows ...
  car_list : listboxes(main_window'access, ...

The problem is that I want to make sure that CreateWindow has been
called for main_window before car_list is used, and I want a
compilation error if that isn't the case.  The only way I can see to
accomplish that is to make the declaration of main_window somehow
call CreateWindow.  That could be done either with an initialization
procedure, or by forcing the user to call a function assigning a
value:

  main_window : frame_windows:=create(various parameters);

But the function option is not available if frame_windows is limited.

So I'm back to a 'procedure initialize' which calls CreateWindow.
Now it could make that call with default values for position, size,
title, wndproc, and everything else and expect the user to make a
later procedure call or calls to change those to real values, or it
could get their values from discriminants 'initial_width,
initial_title' etc.  (Some of which can have default values, of
course.)  The latter seems simpler to me.

    I admit here to a personal preference for stack order rather
than heap order creation/destruction of things unless lifetime
requirements or something really require random heap order.  It
tends to keep things more orderly and in this case, given that a
window can be minimized or hidden, it doesn't seem to prevent any
needed flexibility.  Putting the CreateWindow call in the
declarations, rather than some arbitrary place in the sequence of
statements, fits that policy even if there were no listboxes etc.




             reply	other threads:[~1996-04-27  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-27  0:00 tmoran [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-04-26  0:00 access to subprogram disciminants tmoran
1996-04-26  0:00 ` Tucker Taft
1996-04-26  0:00 ` Robert I. Eachus
1996-04-24  0:00 tmoran
1996-04-25  0:00 ` Tucker Taft
1996-04-23  0:00 tmoran
1996-04-24  0:00 ` Tucker Taft
replies disabled

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