I tried GUI-Server 0.3 from newLISP.dll and set:
(gs:listen true)
So my app keep open onClose.
I was not able to restart the GUI after the first close.
What is the correct way to close and to restart the GUI ?
Is it possible to use it that way?
GUI server restart after closing
GUI server restart after closing
Hans-Peter
Normally the gs:listen loop will exit when communication with guiserver.jar is interrupted. The 'true flag keeps newlisp running (or in your case newlisp.dll).
But you should still be able to close the gui part (i.e. by clicking on the x icon)
Or did the network routines fail when trying to connect the second time?
Perhaps the port newlisp.dll was using have to be closed. Change the gs:listen routine in guiserver.lsp to the following:
If this works for dll mode let me know and I can add it.
Lutz
But you should still be able to close the gui part (i.e. by clicking on the x icon)
Was Java still running in Windows task manager?I was not able to restart the GUI after the first close.
Or did the network routines fail when trying to connect the second time?
Perhaps the port newlisp.dll was using have to be closed. Change the gs:listen routine in guiserver.lsp to the following:
Code: Select all
(define (listen flag)
(while (net-receive in 'event 100240 "\n")
(eval-string event))
(println "server shut down")
(if (not flag) (exit))
(net-close listenSock)
)
Lutz
No, it disappears.Was Java still running in Windows task manager?
Seems so.Or did the network routines fail when trying to connect the second time?
First time it shows:
Code: Select all
server listening on 47011
server accepted from 0.0.0.0
server connecting to 0.0.0.0:47012
server connected
Code: Select all
server listening on 47011
Java reloads to around 15 MB instead of 23 MB the first time.
Not returning from: (load "c:/Programme/newlisp/widgets-demo.lsp")
Did not solve this problem.Perhaps the port newlisp.dll was using have to be closed. Change the gs:listen routine in guiserver.lsp to the following:
Hans-Peter
when you run a GUI app from newlis.dll how do you start it the 1st and the 2nd time? I guess you are using NeoBook to import newlisp.dll?
It looks like the newlisp.ddl doesn't try to do the net-connect the second time or fails on it for some reason.
This is not easy to debug and I will not get to this until later, completing the 2D functionality and making sure things work when invoked from the normal newlisp executable first. Perhaps you can find a workaround, unloading newlisp.dll and then loading it again?
Lutz
It looks like the newlisp.ddl doesn't try to do the net-connect the second time or fails on it for some reason.
This is not easy to debug and I will not get to this until later, completing the 2D functionality and making sure things work when invoked from the normal newlisp executable first. Perhaps you can find a workaround, unloading newlisp.dll and then loading it again?
Lutz
Turns out there is a simple solution. Make the following change in 'gs:init' in guiserver.lsp:
now you shoud be able to so multiple restarts from the DLL. This will be included in future versions of guiserver.lsp. You still have to put the optional 'true in (gs:listen true)
Lutz
Code: Select all
...
(set 'retry 0)
(set 'out nil) ; <=== add this statement
(while (not out)
...
Lutz