[REBOL] Pane Refresh Problem
From: coussement::c::itc::mil::be at: 2-May-2001 11:29
Hi list:
For experimenting with /View, I've written another "Game of Life".
The algorithm works OK with an ASCII output, but I cannot get the result in
/view, because I don't know how to trigger a refresh of the pane.
Here's the code I use for the visual part - max-x and max-y are global words
setting the size of the life map.
<snip>
show-visual: func [
/local x y main society
][
main: layout [
vh2 "Game of Life"
guide
pad 20
button "QUIT" [unview halt]
return
box 2x140 yellow
return
panels: box 300x300
]
society: [
origin 8x8
backdrop black across space 1x1
style alive box red 10x10
style dead box black 10x10
return
]
forever [
make-live ;--- create the life map
;--- dynamically append boxes to pane
for x 1 max-x 1 [
for y 1 max-y 1 [
either (alive? x y)[
append society 'alive
][
append society 'dead
]
]
append society 'return
]
panels/pane: layout society
show panels/pane
view main
]
]
</snip>
It works if I close the generated windowat each generation.
It's for sure not difficult, but I cannot find anything in the Doc :-(
Any idea ?
chr==