GUI from newLISP.dll

Started by HPW, June 08, 2007, 11:38:38 PM

Previous topic - Next topic

HPW

When I try a:


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

from newLISP.DLL



I get a console window with title: C:Windowssystem32java.exe


Quoteserver 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

#1
QuoteCan 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">http://newlisp.org/index.cgi?page=Code_Snippets. Pjot is also distributing an app to start a Windows app, w/o the shell windows.


QuoteCan I avoid the complete closing


I will add  a parameter to to gs:listen suppress the default closing behaviour.



Lutz

HPW

#2
This neobook script allow me to start java without the console window:

(I remove the similar start code gs:init)


Run "java" "-jar [#34]C:\Programme/newlisp/guiserver.jar[#34] 47011" "Hidden" "" ""

QuoteI 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

#3
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.


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:


Java -jar c:Program Filesnewispguiserver.jar 47011 c:homemyapp.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

#4
When I try 2 then I get:



C:Programmenewlisp>Java -jar c:Programmenewlispguiserver.jar 47011 c:Progr
ammenewlispwidgets-demo.lsp
guiserver starting newLISP ->c:Programmenewlispwidgets-demo.lsp 47011 javasta
rt &<-
Exception in thread "main" java.io.IOException: Cannot run program "c:Programme
newlispwidgets-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:Programmenewlisp>


QuoteDon'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

#5
I think you mean it this way:


Java -jar c:Programmenewlispguiserver.jar 47011 "c:Programmenewlispnewlisp.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