VID: rate question
[1/9] from: robert::muench::robertmuench::de at: 5-Nov-2002 18:52
Hi, I have the following structure (stripped pseudo-code):
My-face: Face [
rate 10
... Do something on overy event
]
Than I have a piece of code that does the following:
My-box/pane: layout my-layout
Foreach a set [
append my-box/pane/pane my-face
]
So after viewing my-box the events for the appended faces start to run.
The problem is how do I get rid of the event triggering again?
I tried: hide my-box/pane/pane, hide my-box/pane etc. The pane is
invisible but the rate still fires it's events. Any idea how to stop
this again? Robert
[2/9] from: petr:krenzelok:trz:cz at: 5-Nov-2002 19:29
Robert M. Muench wrote:
>Hi, I have the following structure (stripped pseudo-code):
>My-face: Face [
<<quoted lines omitted: 11>>
>invisible but the rate still fires it's events. Any idea how to stop
>this again? Robert
I think it relates to old bug, although Holger IIRC told us, that it is
actually not a bug. So IIRC, Cyphre asked for some kind of freeze
function, which would freeze event flow for certain face, but I think it
was not implemented yet and I am not also sure it was confirmed by RT
that it would be even done that way ....
-pekr-
[3/9] from: rotenca:telvia:it at: 5-Nov-2002 19:18
Try to set rate at none.
---
Ciao
Romano
[4/9] from: greggirwin:mindspring at: 5-Nov-2002 16:16
Hi Robert,
As Romano said, set the RATE to none for the face. I think you also need to
SHOW the face after that to force the system to see the change.
--Gregg
[5/9] from: carl:s:rebol at: 5-Nov-2002 16:26
Here is a really important tip for timer/rate related code in VID:
Just setting the fields of a FACE object are not enough, you need to have
those fields evaluated. For optimization reasons, fields only get evaluated
when you ask them to be. To evaluate such changes, call SHOW, even if you
are just trying to turn something off (like disabling a timer). All the
timer related code requires this.
-Carl
At 06:52 PM 11/5/02 +0100, you wrote:
[6/9] from: robert:muench:robertmuench at: 9-Nov-2002 11:02
> -----Original Message-----
> From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]
<<quoted lines omitted: 10>>
> are just trying to turn something off (like disabling a
> timer). All the timer related code requires this.
Does this evaluation happen for HIDE too? Robert
[7/9] from: robert:muench:robertmuench at: 9-Nov-2002 11:02
> -----Original Message-----
> From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]
<<quoted lines omitted: 3>>
> Subject: [REBOL] Re: VID: rate question
> Try to set rate at none.
Hi, ok thanks for the tip. I now tried to HIDE the container face and
this seems to stop the timers as well... Just wondering.
BTW, one more question, will a reference to a face be keept if it has a
rate <> 0? So that the face, even if it's not visible, won't be released
by the system? Robert
[8/9] from: rotenca:telvia:it at: 9-Nov-2002 14:30
Hi Robert,
> BTW, one more question, will a reference to a face be keept if it has a
> rate <> 0? So that the face, even if it's not visible, won't be released
> by the system?
For what I know, any value (among them, also faces) is kept in memory until
any-block keeps a reference to it or until a word keeps a reference to it with
the mediation of any context (use, function, object). A bug in parse made this
not always true for parse rule blocks.
Also without a word which points to it, an hide face usually remains in the
pane block/field if nobody remove it.
---
Ciao
Romano
[9/9] from: cyphre:seznam:cz at: 11-Nov-2002 11:51
Hi Robert,
----- Original Message -----
From: "Robert M. Muench" <[robert--muench--robertmuench--de]>
To: <[rebol-list--rebol--com]>
Sent: Saturday, November 09, 2002 11:02 AM
Subject: [REBOL] Re: VID: rate question
> Hi, ok thanks for the tip. I now tried to HIDE the container face and
> this seems to stop the timers as well... Just wondering.
>
Yes, HIDE command recursively stops timers in all subfaces which is logical
and very handy in many situations, try following code:
my-feel: make face/feel [
engage: func [f a e][
if a = 'time [
print [f/text "face time event"]
]
]
]
view layout [
bx: box red with [
rate: 1
text: "red"
feel: make my-feel []
pane: make face [
text: "blue"
color: blue
offset: 20x20
size: 30x30
rate: 1
feel: make my-feel []
]
]
button "hide" [hide bx]
button "show" [show bx]
]
I would also invite a little improvement for recursively stopping timers
without the need to hide all the faces. It is more than one year when holger
answer to my question on /Express cofnerence:
Removing timeouts without hiding a face ? The solution is probably
something like
face/changes: 'timeout show face" in the next version. We
are already using face/changes in some other places to limit the work show
has to do, and to avoid flickering. Seems like a natural addition."
Question for Carl: Would be possible to add such feature into the upcomming
new version of /View?
regards,
Cyphre
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted