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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-01 09:25:56 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!logbridge.uoregon.edu!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3A9E77D4.D40FEAA@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: JGNAT and Null references Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 01 Mar 2001 17:23:31 GMT NNTP-Posting-Host: 158.252.123.81 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 983467411 158.252.123.81 (Thu, 01 Mar 2001 09:23:31 PST) NNTP-Posting-Date: Thu, 01 Mar 2001 09:23:31 PST Xref: supernews.google.com comp.lang.ada:5357 Date: 2001-03-01T17:23:31+00:00 List-Id: Let me just plow right into an annotated example here, rather than trying to explain it first... The Java class javax.swing.JTabbedPane provides a method called addTab that looks like this: public void addTab(String title, Icon icon, Component component, String tip) 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 which is perfectly correct since that P2_Icon parameter requires a pointer to , or the "'access of" an actual object. Buuuuuut, I don't have, or want to pass, an Icon to display with the tab, and specifying "null" is how I would indicate that in Java. What do I provide as a "null argument" in JGNAT? I was hoping to find some sort of predefined "null_reference" constant, analogous to System.Null_Address, but no such luck. Thanks much, Marc A. Criley