I wish I could help with the reason the connection is lost, but I don't
know enough about Gnoga to answer that.  That's more of a Pascal or David
question.  If a connection is truly lost, you do have some ways to run code
at that point.  If running Singleton apps, just use the code space after
your call to Application.Singleton.Message_Loop.  If in multi-connect, then
go to you On_Connect handler for the connection and put a Connection.Hold;
line at the bottom of it.  It will hold the thread there until the
connection is lost.  Now you can either put code below that line that will
run when the connection is lost or setup your own custom handler.  Since
Gnoga events are concurrent, holding the On_Connect handler won't affect
your GUI functionality (assuming it is after your code that actually
generates the GUI layout).  NOTE:  I don't know if exceptions bypass this,
so you may need to catch an exception first or something...not sure.

Separately, it might also be worth your while to look at the private full
view of both Window_Type and Base_Type
https://sourceforge.net/p/gnoga/code/ci/dev_1.3/tree/src/gnoga-gui-window.ads
https://sourceforge.net/p/gnoga/code/ci/dev_1.3/tree/src/gnoga-gui-base.ads

It will list all the possible events for the Window and most other Gnoga
components.  For individual specialized Gnoga components, check out their
definitions.

The prospect of Ada on android has always got me excited.  I'm hoping it
does continue to develop.

On Wed, Jan 10, 2018 at 12:39 PM, Brian Drummond <br...@shapes.demon.co.uk>
wrote:

> On Tue, 2018-01-09 at 23:38 -0500, Jeremiah Breeden wrote:
> > Wouldn't MyView.Width just return the width of that view?  On a phone
> > it would be similar to the screen size, but on something like a
> > laptop or desktop it might not be (depends on if the browser is
> > maximized or not).  Something to consider at least.
>
> Indeed, it is the browser window size upon opening, which is good
> enough for current purposes.
>
> However one part of the picture I don't get is how my View can get
> notified when something changes : e.g. the width changes (I rotated the
> phone) or the connection is lost (that background Ping fails to respond
> for some reason).
>
> For Destroy events, I can attach an On_Destroy_Handler
>       View.On_Destroy_Handler (On_Destroy'Access);
> and On_Destroy gets called as expected, but what can I do about other
> types of change imposed on my View (size, dropped connection) by the
> client (browser)?
>
> Been through the tutorial and some of the demos but missed this.
>
> Thanks for your help!
>
> -- Brian
>
> (ps : why is the phone of interest?
>
> Some years ago John Marino got a bare Ada compiler going on Android -
> http://www.dragonlace.net/
> and I managed to reproduce that work but made no progress on
> integrating the GUI via the NDK.
>
> Seems to me that if that can be made to work, perhaps Gnoga on the
> phone/tablet via its own browser, might be a practical way to develop
> without having to deal with the Java level or NDK)
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to