development GUI-server v. 0.92

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

development GUI-server v. 0.92

Post 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

Ryon
Posts: 248
Joined: Thu Sep 26, 2002 12:57 am

Post 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?

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

Post 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

Ryon
Posts: 248
Joined: Thu Sep 26, 2002 12:57 am

Post by Ryon »

Oh. I knew that!
:-$

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post 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.
-- (define? (Cornflakes))

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post 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)
-- (define? (Cornflakes))

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

Post 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

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post 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.
-- (define? (Cornflakes))

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

Post 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

Sleeper
Posts: 24
Joined: Fri Nov 24, 2006 2:24 pm

Post 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

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

Post 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

Sleeper
Posts: 24
Joined: Fri Nov 24, 2006 2:24 pm

Post 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

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

Post 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?

Locked