gs:hide-tag

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

gs:hide-tag

Post by newdep »

Hi Lutz,

There is something strange with 'gs:hide-tag,
sometimes it updates sometimes it does not..

If I use the boolean or not it does not update the screen.
show-tag works oke..

The example below does not work properly..

I need to resize the screen to get gs:hide-tag working..(an event)..

With or without the 'true is does not work refresh,
seems gs:hide-tag does it only once and then needs a refresh..

If I remove the sleep's, it doesnt help eighter..

Also, Seems that the rewrite of the tag changes my color, the red
in the screen turn 1 step darker...this also happens with gs:update..




#!/usr/bin/newlisp

;;;; initialization
(if (= ostype "Win32")
(load (string (env "PROGRAMFILES") "/newlisp/guiserver.lsp"))
(load "/usr/share/newlisp/guiserver.lsp"))

(gs:init)
(gs:get-screen)
(gs:frame 't 100 100 200 200 "")
(gs:set-background 't gs:black)
(gs:canvas 'canvas t)
(gs:add-to 't 'canvas)
(gs:set-visible 't true)

(for (r 0 200 6)
(gs:fill-circle (string "L" r) (+ r 3) 9 3 gs:red))

(sleep 5000)
(gs:hide-tag "L6" true)
(sleep 5000)
(gs:show-tag "L6" true)
(sleep 5000)
(gs:hide-tag "L6" true)
-- (define? (Cornflakes))

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Yes I can't get this one to work. I have used hide-tag successfully, though. (http://www.alh.net/newlisp/phpbb/viewto ... ht=hidetag)

but I can't see why that works OK.

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

Post by Lutz »

The canvas needs a backgroud color in order to get repainted:

http://newlisp.org/guiserver/guiserver. ... #gs_canvas

in your program put this after your canvas definition:

Code: Select all

(gs:set-background 'canvas gs:black) 
Lutz

ps: the background color is used to erase the canvas before repainting it.

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

Post by newdep »

Pretty tricky actualy, i was under the impression that a background on
the frame was enough..., but it now works like a charm thanks!

Norman.
-- (define? (Cornflakes))

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Aah! Of course - that explains it...

Locked