comp.lang.ada
 help / color / mirror / Atom feed
From: Jeremiah <jeremiah.breeden@gmail.com>
Subject: Re: Launching Popup Windows in Gnoga
Date: Mon, 20 Oct 2014 15:01:31 -0700 (PDT)
Date: 2014-10-20T15:01:31-07:00	[thread overview]
Message-ID: <e61eac40-31ea-4bc1-96ee-1ed9d24c2d70@googlegroups.com> (raw)
In-Reply-To: <307b4479-1449-4de2-94ff-d960a140f198@googlegroups.com>

On Monday, October 20, 2014 11:22:12 AM UTC-4, David Botton wrote:
> Also you will notice in Tutorial 6 that Launch now throws an exception if popups are blocked Gnoga.Gui.Window.Popup_Blocked

Thanks for the update.  I tried it out, but the popup portion seems to be hosing it.  Even with popup blocking turned completely off, I still get the exception.  

On IE I get:
Dispatch Error
CONSTRAINT_ERROR - bad input for 'Value: "undefined"

On FF I get:
Dispatch Error
GNOGA.GUI.WINDOW.POPUP_BLOCKED - gnoga-gui-window.adb:556

This is with the current version as of 5pm EST.

The window still pops up, but the view isn't attached so it is an empty popup (in both IE and FF).

This is my test code.  It has some logic holes, but was just tossing some stuff up to test what you mentioned above


************************************************
with Gnoga.Application.Singleton;
with Gnoga.Gui.Window;
with Gnoga.Gui.View;
with Gnoga.Gui.Base;
with Gnoga.Gui.Element.Common;
with Gnoga.Gui.Document;  use type Gnoga.Gui.Document.Ready_State_Type;

with Ada.Text_IO;  use Ada.Text_IO;

procedure Main is
   Main_Window  : Gnoga.Gui.Window.Window_Type;
   Main_View    : Gnoga.Gui.View.View_Type;
   Main_Button  : Gnoga.Gui.Element.Common.Button_Type;

   Popup_View   : Gnoga.Gui.View.View_Type;
   Popup_Button : Gnoga.Gui.Element.Common.Button_Type;
   
   procedure On_Popup_Button_Click( Obj : in out Gnoga.Gui.Base.Base_Type'Class) is
   begin
      Main_View.Put_Line("Popup Clicked!");
   end On_Popup_Button_Click;


   procedure On_Main_Button_Click( Obj : in out Gnoga.Gui.Base.Base_Type'Class) is
      Popup_Window : Gnoga.Gui.Window.Window_Type;
   begin
      Main_View.Put_Line("Main Clicked!");
      Popup_Window.Launch (Parent => Main_Window,
                           URL      => "",
                           Width    => 500,
                           Height   => 500,
                           Left     => 50,
                           Top      => 50,
                           Location => False,
                           Menu     => False,
                           Status   => False,
                           Tool_Bar => False,
                           Title    => False);
      while
        Popup_Window.Document.Ready_State /= Gnoga.Gui.Document.Complete or
        Popup_Window.Width = 0
      loop
         delay 0.25;
      end loop;
      
      Popup_View.Create(Popup_Window);
      Popup_Button.Create(Popup_View,"Click Me Too!");
      Popup_Button.On_Click_Handler(On_Popup_Button_Click'Unrestricted_Access);
      
   end On_Main_Button_Click;

   

begin
   Gnoga.Application.Title("Hello World");

   Put_Line("Hello World");

   --Gnoga.Application.Open_URL_Windows;
   Gnoga.Application.Singleton.Initialize(Main_Window => Main_Window);

   Main_View.Create(Parent => Main_Window);

   Main_View.Put_Line("Hello World");
   Main_Button.Create(Main_View,"Click Me");

   Main_Button.On_Click_Handler(On_Main_Button_Click'Unrestricted_Access);

   Gnoga.Application.Singleton.Message_Loop;
   Put_Line("Application finished");

end Main;


  reply	other threads:[~2014-10-20 22:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20 12:56 Launching Popup Windows in Gnoga Jeremiah
2014-10-20 13:38 ` David Botton
2014-10-20 15:22 ` David Botton
2014-10-20 22:01   ` Jeremiah [this message]
2014-10-20 22:30     ` David Botton
2014-10-20 23:07       ` Jeremiah
2014-10-21  0:21         ` David Botton
2014-10-21  0:27           ` David Botton
2014-10-21  1:27             ` David Botton
2014-10-21  2:06               ` jeremiah.breeden
2014-10-21 11:24               ` David Botton
2014-10-22  1:56                 ` Jeremiah
2014-10-22  2:09                   ` David Botton
2014-10-22  2:57                     ` Jeremiah
2014-10-22 15:24                       ` David Botton
2014-10-21  2:03           ` Jeremiah
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox