Page 1 of 1

gs:hide-tag

Posted: Sun Sep 16, 2007 12:10 pm
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)

Posted: Sun Sep 16, 2007 3:09 pm
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.

Posted: Sun Sep 16, 2007 4:37 pm
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.

Posted: Sun Sep 16, 2007 4:57 pm
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.

Posted: Sun Sep 16, 2007 5:33 pm
by cormullion
Aah! Of course - that explains it...