Page 1 of 1
development GUI-server v. 0.92
Posted: Fri Jun 22, 2007 11:43 am
by Lutz
* new functions for getting system properties for version, screen and installed fonts
* two new demos: allfonts-demo.lsp and properties-demo.lsp
* increased size for data transfer between serrver and application
* gs:no-event void action-handlers in widgtets
Files:
http://newlisp.org/downloads/development/
Changes notes:
http://newlisp.org/downloads/developmen ... er-092.txt
Docs:
http://newlisp.org/downloads/developmen ... rver-0.92/
Lutz
Posted: Fri Jun 22, 2007 3:44 pm
by Ryon
FWIW, allfonts-demo.lst, properties-demo.lst, and newdep's '[gag] new lisp' posted here today:
invalid function : (gs:get-screen)
Using guiserver-0.92, newLISP v.9.1.1, under XP.
Maybe I missed a readme?
Posted: Fri Jun 22, 2007 4:09 pm
by Lutz
Maybe I missed a readme?
probably ;-), with every new version of GUI-server you have to copy guiserver.lsp and guiserver.jar into /usr/share/newlisp (on MacOX X, UNIX) or ionto c:\Program Files\newlisp on Windows.
Lutz
Posted: Fri Jun 22, 2007 5:39 pm
by Ryon
Oh. I knew that!
:-$
Posted: Fri Jun 22, 2007 7:09 pm
by newdep
Hi Lutz,
Seems im unable to set the background of a gs:label..
I thought this worked in 0.7 ? or not? ;-)
Norman.
Posted: Fri Jun 22, 2007 7:49 pm
by newdep
Hi Lutz,
The code below works..but when I change gs:frame into gs:window
the label seems to be gone?? or someting else?
(if (= ostype "Win32")
(load (string (env "PROGRAMFILES") "/newlisp/guiserver.lsp"))
(load "/usr/share/newlisp/guiserver.lsp"))
(gs:init)
(gs:get-screen)
(gs:set-look-and-feel "javax.swing.plaf.metal.MetalLookAndFeel")
(gs:frame 'T 0 (div (- (gs:screen 1) 300) 2) (gs:screen 0) 300 " " )
(gs:set-grid-layout 'T 1 0 0 0 )
(gs:panel 'P)
(gs:set-background 'P 0 0 0)
(gs:label 'TAG "NEEEOOON" )
(gs:add-to 'P 'TAG)
(gs:add-to 'T 'P)
(gs:set-visible 'T true)
(while
(sleep 200)
(gs:set-font 'TAG "Monospaced" 218 "bold")
(gs:set-foreground 'TAG '(0.87058824 0.95686275 0.15294118 0.2))
(sleep 100)
(gs:set-font 'TAG "Monospaced" 216 "bold")
(gs:set-foreground 'TAG 0 0.5 0))
(exit)
Posted: Fri Jun 22, 2007 8:36 pm
by Lutz
The frameless windows in GUI-server is a different animal then all other Widgets in GUI-server, it does not belong to the Java Swing family, but is a lower level widget, and many things behave differently. I haven't figured out all differences yest, you have to experiment.
But if you take out the panel and put the label directly into the windows it works. In either case with gs:windows or with gs:frame, you don't need the panel in-between but can put the label directly. Here is a simplified version which works:
Code: Select all
(if (= ostype "Win32")
(load (string (env "PROGRAMFILES") "/newlisp/guiserver.lsp"))
(load "/usr/share/newlisp/guiserver.lsp"))
(gs:init)
(gs:get-screen)
(gs:set-look-and-feel "javax.swing.plaf.metal.MetalLookAndFeel")
(gs:window 'T 0 (div (- (gs:screen 1) 300) 2) (gs:screen 0) 300 " " )
(gs:set-background 'T 0 0 0 0) ; put this on MacOS X for floating letters
(gs:label 'TAG "NEEEOOON" )
(gs:add-to 'T 'TAG)
(gs:set-visible 'T true)
(while (sleep 200)
(gs:set-font 'TAG "Monospaced" 218 "bold")
(gs:set-foreground 'TAG '(0.87058824 0.95686275 0.15294118 0.2))
(sleep 100)
(gs:set-font 'TAG "Monospaced" 216 "bold")
(gs:set-foreground 'TAG 0 0.5 0))
(exit)
An additional observation: there is now grid-layout with 1 row and 0 columns, you must have at least 1 column.
But the grid-layout is not necessary here. You can just add anything to a frame or window directly, and it will expand to full size, as if in a grid-layout of one cell. I also do this in frameless-demo.lsp and property-demo.lsp. BTW if you make the window transparent on MacOS X it looks like NEEEOOON is floating.
Lutz
Posted: Fri Jun 22, 2007 8:56 pm
by newdep
Aha right oke ill give it a try...
Btw.. I used the extra gs:panel because it seems that using this panel
I dont have a flicker in the gs:font loop, which is more smooth...
Seems Java is only refreshing the panel in that case and not the whole screen..
There is a way in Linux to make root-windows transparent,
I read once, cant remember for sure but there are some upgrades needed
on X or some changes. Anyway pitty i dont have the transparent look here ;-)
It would be nice if guiserver would have somekind of a tone-generator..to
make some sounds... not sure if that is easy or possible..
Something like: (gs:tone rate duration volume) but then again that would
become an extra thread perhpas..
Oh yes 2 other questions...
What is the use of gs:dispose ?
And I assume gs:canvas is not doing any extra's yet?
Norman.
Posted: Fri Jun 22, 2007 9:58 pm
by Lutz
it would be nice if guiserver would have somekind of a tone-generator..to make some sounds...
when doing the 2D graphics stuff I will dig a little bit into the Java multimedia API.
What is the use of gs:dispose
for destroying frames, dialogs and windows from a program; haven't tried it out much. For other components use gs:remove-from
And I assume gs:canvas is not doing any extra's yet?
similar to a gs:panel, but used for drawing graphics and text, and it also can have mouse and keyboard handlers attached to it. This way you can roll your own-whatever-you-want :-).
Lutz
Posted: Sun Jun 24, 2007 6:53 pm
by Sleeper
Hi, Lutz!
maybe i missed something but newlisp-edit.lsp doesn't work on my system.
it shows an error:
message-dialog:
cannot be applied to MAIN:TheEditor
and then it exits
all other demos works fine
Posted: Sun Jun 24, 2007 8:28 pm
by Lutz
you probably did not update guiserver.jar and guserver.lsp in /usr/share/newlisp or c:\Program Files\newlisp
read here:
http://newlisp.org/downloads/developmen ... readme.txt
also, use all files from the same version (0.92 at the moment)
Lutz
Posted: Sun Jun 24, 2007 8:42 pm
by Sleeper
i have updated all this files to the latest version before posting here
just checked this again
i have newlisp 9.1.1 installed. maybe this is the reason
Posted: Sun Jun 24, 2007 9:39 pm
by Lutz
9.1.1 runs fine, only versions 9.1.4/5/6 pose a problem, versions 9.1.7/8 are fine too. The error message you are reporting really looks like you are using an outdated version of either guiserver.jar guiserver.lsp or newlisp-edit.lsp. Please check again ;)
Lutz
ps: if that doesn't help tell me which of the 12 demos are running and which not, and are you running Windows XP, or which OS?