Color with GUI-server in version 9.2.6

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE
Locked
newBert
Posts: 156
Joined: Fri Oct 28, 2005 5:33 pm
Location: France

Color with GUI-server in version 9.2.6

Post by newBert »

When I do this (with NewLISP 9.2.6 on Win32):

Code: Select all

;---------------------
; initialize GUI-server
;---------------------
(load (append (env "NEWLISPDIR") "/guiserver.lsp")) 
(gs:init) 
;-------------------------
; constants and variables
;-------------------------
; GUI size:
(constant 'WIDTH 500 'HEIGHT 300)
;----------------
; create the GUI
;----------------
(gs:frame 'WIN 100 100 WIDTH (+ HEIGHT 32) "NewLISP 9.2.6 on Win32")
;; the console
(gs:text-area 'Console 'action WIDTH HEIGHT)
(gs:set-editable 'Console nil)
(gs:set-background 'Console gs:white)
(gs:set-font 'Console "Monospaced" 12 "plain")
(gs:set-foreground 'Console gs:black)
(gs:add-to 'WIN 'Console)
(gs:set-visible 'WIN true)
;-----------------
; define actions
;-----------------
(define (action))
;------------------
; events loop
;------------------
(gs:listen true)
I should obtain a window with a white background, thanks to (gs:set-background 'Console gs:white), but now the background is rather purple !
What's the matter ?
:)

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

Post by Lutz »

All colors are defined with folating point numbers decimal separator as a point in guiserver.lsp. But your UTF-8 enabled version expects a comma.

Put this as your very first statement in your program:

Code: Select all

(set-locale "C")
This will switch back to a point as a separator in your location.

Development version 9.2.7 (later this weekend) will not be UTF-8 enabled and treat everything as in 9.2.5 ;-)

Lutz

newBert
Posts: 156
Joined: Fri Oct 28, 2005 5:33 pm
Location: France

Post by newBert »

Lutz wrote:All colors are defined with folating point numbers decimal separator as a point in guiserver.lsp. But your UTF-8 enabled version expects a comma.

Put this as your very first statement in your program:

Code: Select all

(set-locale "C")
This will switch back to a point as a separator in your location.

Development version 9.2.7 (later this weekend) will not be UTF-8 enabled and treat everything as in 9.2.5 ;-)

Lutz
I'm so silly ! I missed that ... thank you for the reply ;)

Locked