GUI from newLISP.dll

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE
Locked
HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

GUI from newLISP.dll

Post by HPW »

When I try a:

Code: Select all

(load "c:/Programme/newlisp/widgets-demo.lsp")
from newLISP.DLL

I get a console window with title: C:\Windows\system32\java.exe
server listening on 47011
server accepted from 0.0.0.0
server connecting to 0.0.0.0:47012
server connected
and the GUI shows up as expected.
But when I close the Java-GUI it also close the main-calling process.

Questions:

Can I launch the GUI without the visible java-console window?

Can I avoid the complete closing, so that newLISP.dll simply returns from the call to the calling app?
(Maybe (gs:listen) should get a parameter if complete closing is wanted.)
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Can I launch the GUI without the visible java-console window?
try one of the methods shown here: http://newlisp.org/index.cgi?page=Code_Snippets. Pjot is also distributing an app to start a Windows app, w/o the shell windows.
Can I avoid the complete closing
I will add a parameter to to gs:listen suppress the default closing behaviour.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

This neobook script allow me to start java without the console window:
(I remove the similar start code gs:init)

Code: Select all

Run "java" "-jar [#34]C:\\Programme/newlisp/guiserver.jar[#34] 47011" "Hidden" "" ""
I will add a parameter to to gs:listen suppress the default closing behaviour.
Thanks, that will help to use it in this situation.
Of cource this can be used for kind of modal sub dialogs, because the newLISP call will not return until the GUI is closed.

Anyway, another powerfull option to use the new GUI stuff!
Keep it getting better!
;-)
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Don't remove anything in gs:init (not sure if I understood you well).

There are already two methods existent to start a guiserver application:

(1) start the newLISP code and it will call gs:init which starts the guiserver.jar. This method in described in the modules helpfile.

Code: Select all

newlisp mypapp.lsp
; on Mac OS X, Unix
./myapp.lsp
(2) start guiserver.jar with Java and supply portnummber and newLISP code as a parameter:

Code: Select all

Java -jar c:\Program Files\newisp\guiserver.jar 47011 c:\home\myapp.lsp
The second method is best for packageing guiserver apps. On windows desktop an icon-link can be configured this way (similar to the existing Win32 icon for newLISP-tk)

On MacOS X the /Developer/Applications/Java Tools/Jar Bundder.app and the /Applications/Utilities/Disk Utility.app can be used to packaged and distributed a Guiserver application with Icon and located in the Applications folder.

One of the next development releases will have installers which install applictions icons on both platforms this way.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

When I try 2 then I get:

Code: Select all

C:\Programme\newlisp>Java -jar c:\Programme\newlisp\guiserver.jar 47011 c:\Progr
amme\newlisp\widgets-demo.lsp
guiserver starting newLISP ->c:\Programme\newlisp\widgets-demo.lsp 47011 javasta
rt &<-
Exception in thread "main" java.io.IOException: Cannot run program "c:\Programme
\newlisp\widgets-demo.lsp": CreateProcess error=193, %1 ist keine zulõssige Win3
2-Anwendung
        at java.lang.ProcessBuilder.start(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at guiserver.execCommand(guiserver.java:108)
        at guiserver.main(guiserver.java:53)
Caused by: java.io.IOException: CreateProcess error=193, %1 ist keine zulõssige
Win32-Anwendung
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(Unknown Source)
        at java.lang.ProcessImpl.start(Unknown Source)
        ... 6 more

C:\Programme\newlisp>
Don't remove anything in gs:init (not sure if I understood you well).
I do it because I start the GUIserver hidden from my main neobook app, and then I load the widgets-demo by the newLISP.dll and there I will avoid a second java start with the console window.
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

I think you mean it this way:

Code: Select all

Java -jar c:\Programme\newlisp\guiserver.jar 47011 "c:\Programme\newlisp\newlisp.exe widgets-demo.lsp"
That works for as it start the GUI-Server and newLISP.EXE

But since I was using the DLL it would not work for me.
But it would be no problem to adapt guiserver.lsp for that.
Or you add another parameter for (gs:init) to disable the java start.
Hans-Peter

Locked