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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.246.3 with SMTP id xs3mr21207534obc.13.1413846436743; Mon, 20 Oct 2014 16:07:16 -0700 (PDT) X-Received: by 10.140.95.66 with SMTP id h60mr234134qge.3.1413846436637; Mon, 20 Oct 2014 16:07:16 -0700 (PDT) Path: border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!h18no8183403igc.0!news-out.google.com!u5ni8qab.1!nntp.google.com!w8no53163qac.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 20 Oct 2014 16:07:16 -0700 (PDT) In-Reply-To: <9ebb7994-aaf1-4eec-a335-bd72ff0acd6b@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=108.44.225.195; posting-account=vk6_JwoAAABkMyHO1YfdP69Hm3CpbdGR NNTP-Posting-Host: 108.44.225.195 References: <307b4479-1449-4de2-94ff-d960a140f198@googlegroups.com> <9ebb7994-aaf1-4eec-a335-bd72ff0acd6b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Launching Popup Windows in Gnoga From: Jeremiah Injection-Date: Mon, 20 Oct 2014 23:07:16 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.giganews.com comp.lang.ada:189925 Date: 2014-10-20T16:07:16-07:00 List-Id: On Monday, October 20, 2014 6:30:12 PM UTC-4, David Botton wrote: > Your issue is not with popups, but an Ada issue. >=20 >=20 >=20 > Popup_Window will finalize at the end of the procedure On_Main_Button_Cli= ck, even though the popup will remain on the screen, reference to it has di= sappeared both in Gnoga and on the browser. >=20 >=20 >=20 > Try this instead: >=20 >=20 >=20 > procedure On_Main_Button_Click( Obj : in out Gnoga.Gui.Base.Base_Type'= Class) is=20 >=20 > Popup_Window : Gnoga.Gui.Window.Window_Access :=3D >=20 > new Gnoga.Gui.Window.Window_Type;=20 >=20 > begin=20 Even with that change, the issue I mentioned above exists (The Constraint e= rror on IE and the popup blocked exception on FF). =20 However, my original post was kinda touching on your response. I definitel= y want to avoid memory leaks if possible (I can work around this similar to= your second solution). However, I also need to handle the user clicking o= n the button multiple times. I definitely can't hold onto the reference an= d relaunch the window the next time the button is pressed (at least if I un= derstand your response to the relaunch question correctly). Doing the clos= e/free and allocating a new one gets around that for the window itself, but= I don't know if that has implications on my view object if it is shared am= ongst multiple window objects. As another thought, I'm also still not 100% sure if I would have a race con= dition or synchronization issue if the button was pressed twice (2 popups a= t the same time). I know when I program GUI's in windows exactly what thre= ad the actions happen in. In Gnoga, I'm still looking through to determine= if each on on_click is executed in separate threads/tasks or the same as t= he Main(). I thought about disabling the button to prevent two popups at o= nce, but I wouldn't have an event to remove the disable with later on (espe= cially if they opted to simply close the popup window without clicking my b= uttons).