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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.167.138 with SMTP id q10mr19919694qay.3.1413844211404; Mon, 20 Oct 2014 15:30:11 -0700 (PDT) X-Received: by 10.182.215.136 with SMTP id oi8mr157382obc.0.1413844211234; Mon, 20 Oct 2014 15:30:11 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!w8no47724qac.0!news-out.google.com!rp1ni32382igb.0!nntp.google.com!uq10no14573944igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 20 Oct 2014 15:30:10 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.176.73.77; posting-account=yiWntAoAAAC1KqC_shmxJYv07B9l6LNU NNTP-Posting-Host: 66.176.73.77 References: <307b4479-1449-4de2-94ff-d960a140f198@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9ebb7994-aaf1-4eec-a335-bd72ff0acd6b@googlegroups.com> Subject: Re: Launching Popup Windows in Gnoga From: David Botton Injection-Date: Mon, 20 Oct 2014 22:30:11 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2457 X-Received-Body-CRC: 4166843001 Xref: news.eternal-september.org comp.lang.ada:22618 Date: 2014-10-20T15:30:10-07:00 List-Id: > procedure On_Main_Button_Click( Obj : in out Gnoga.Gui.Base.Base_Type'Class) is > Popup_Window : Gnoga.Gui.Window.Window_Type; > begin Your issue is not with popups, but an Ada issue. Popup_Window will finalize at the end of the procedure On_Main_Button_Click, even though the popup will remain on the screen, reference to it has disappeared both in Gnoga and on the browser. Try this instead: procedure On_Main_Button_Click( Obj : in out Gnoga.Gui.Base.Base_Type'Class) is Popup_Window : Gnoga.Gui.Window.Window_Access := new Gnoga.Gui.Window.Window_Type; begin That will create a dynamic object that will persist after the procedure terminates. However keep in mind that you now have a small memory leak if you never end up calling Popup_Window.Free. For a short lived utility app that may be acceptable. Another example: Popup_Window : Gnoga.Gui.Window.Window_Access := null; procedure On_Main_Button_Click( Obj : in out Gnoga.Gui.Base.Base_Type'Class) is begin if Popup_Window /= null then Popup_Window.Close; Popup_Window.Free; end if; Popup_Winow := new Gnoga.Gui.Window.Window_Type; ... David Botton