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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fc9d2f32aa4c961b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-16 09:38:22 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Help: Tagged Types Date: 16 Nov 2001 12:35:54 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1005932303 7203 128.183.220.71 (16 Nov 2001 17:38:23 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 16 Nov 2001 17:38:23 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:16632 Date: 2001-11-16T17:38:23+00:00 List-Id: "chris.danx" writes: > Hi, > > If we have a decendant of type gwindows.windows.window_type, gl_window_type, > and override it's create procedure, does the following call the create > procedure for gwindows.windows.window_type? No, it dispatches. You want: gwindows.windows.create (gwindows.windows.window_type(window)); Critique of GWindows: In general, it's best if "create" functions are _not_ primitive operations of the type, for precisely this reason. The derived types should have a different "create" function, because they will normally have additional parameters, and the compiler should help the user call the correct one. One way to do this is to put the Create functions in a local nested package. > > -- create a window; > -- > procedure Create > (Window : in out gl_window_type; > Title : in gwindows.GString := ""; > Left : in Integer := GWindows.Constants.Use_Default; > Top : in Integer := GWindows.Constants.Use_Default; > Width : in Integer := GWindows.Constants.Use_Default; > Height : in Integer := GWindows.Constants.Use_Default; > Is_Dynamic : in Boolean := False) is > begin > gwindows.windows.create (gwindows.windows.window_type'class(window)); > ... > ... > end create; > > It compiles ok, but does it do what I intend. It has to initialise a window > of type gl_window_type as if it were gwindows.windows.window_type, then call > some other routines. All I need to know is if this is the correct method to > call the routines of the type which gl_window_type is extended from. > > > > Thanks, > Chris > > -- -- Stephe