Clear area
[1/6] from: hijim:pronet at: 5-Aug-2001 19:45
How can I clear a text area? i've used
my-area/text: "" show my-area
but I get a few characters of garbage on the screen. I've used CLEAR
my-area/text and my-area/text: NONE with the same results. If I use
my-area/text: " " show my-area
(a single space instead of none) I get a clear display with a space at
the head of the text.
How do I do this correctly?
Thanks,
Jim
[2/6] from: arolls::bigpond::net::au at: 6-Aug-2001 15:26
> How can I clear a text area? i've used
> my-area/text: "" show my-area
The empty string referred to above will change
when the user types something into the gadget.
You can change that to;
my-area/text: copy "" show my-area
or as you tried;
clear my-area/text show my-area
Anyway this works for me:
view layout [
a: area "hello^/world"
button [clear a/text show a]
]
(or [a/text: copy "" show a] )
[3/6] from: carl:cybercraft at: 6-Aug-2001 20:13
Neither of your methods work consistantly for me. If I enter lots of
text I'm sometimes left with a line of garbage text at the top, like
Jim was complaining about.
Ah - just remembered something. This from the View docs...
line-list: A BLOCK that is used to track the offsets of text lines
when text is being displayed. When more than 200 characters of text
are being displayed, this list should be set to NONE when large
changes are made to the text. This allows REBOL to recalculate the
locations of all TEXT lines.
So, adding a...
my-area/line-list: none
after you clear your text and before you show it would seem to be the
cure.
On 06-Aug-01, Anton wrote:
>> How can I clear a text area? i've used
>> my-area/text: "" show my-area
<<quoted lines omitted: 10>>
> ]
> (or [a/text: copy "" show a] )
--
Carl Read
[4/6] from: hallvard:ystad:helpinhand at: 6-Aug-2001 10:47
how about
my-area/text: "^(page)" show my-areay
..or is that only for the rebol console?
~H
Du skrev (Monday 06.08.2001, kl. 04.45):
[5/6] from: g:santilli:tiscalinet:it at: 6-Aug-2001 19:16
Hello Jim!
On 06-Ago-01, you wrote:
JC> How can I clear a text area? i've used my-area/text: "" show
JC> my-area but I get a few characters of garbage on the screen.
This happens only if the face is focused, doesn't it? In this
case, just unfocus it before clearing.
focus none
clear myarea/text
show myarea ; or focus myarea
Regards,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[6/6] from: hijim:pronet at: 6-Aug-2001 20:07
my-area/line-list: none
Hi Carl,
This works perfectly every time.
Thanks,
Jim
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted