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,5b27ffedba54a4a2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-01 10:14:07 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!wn4feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3A9E9102.F1E5C294@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: JGNAT and Null references References: <3A9E77D4.D40FEAA@earthlink.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 01 Mar 2001 18:10:21 GMT NNTP-Posting-Host: 12.74.129.24 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 983470221 12.74.129.24 (Thu, 01 Mar 2001 18:10:21 GMT) NNTP-Posting-Date: Thu, 01 Mar 2001 18:10:21 GMT Organization: AT&T Worldnet Xref: supernews.google.com comp.lang.ada:5360 Date: 2001-03-01T18:10:21+00:00 List-Id: "Marc A. Criley" wrote: > > When this class is run through JGNAT's jvm2ada, the Ada equivalent of > that method is: > > procedure addTab (This : access Typ; > P1_String : access java.lang.String.Typ'Class; > P2_Icon : access javax.swing.Icon.Typ'Class; > P3_Component : access java.awt.Component.Typ'Class; > P4_String : access java.lang.String.Typ'Class); > > Okay, so far so good. > > In Java, if I don't have an icon to accompany this tab pane, I can just > supply that parameter with a null: > > jtp.addTab("My title", null, a_component, "a_tool_tip"); > > Attempting this in Ada: > > AddTab(Jtp, +"My title", null, A_Component, +"a_tool_tip"); > > generates an error when compiled: > > null cannot be of an anonymous access type This is easily handled by defining a constant value of a null access type. type Icon_Access is Access all javax.swing.Icon.Typ'Class; Null_Icon : constant Icon_Access := Null; Jim Rogers Colorad Springs, Colorado USA