Set Text Size is empty but then not empty
Sivakatirswami
katir at hindu.org
Sun Jan 8 04:09:40 EST 2006
Yes, we understand that chunks retaining their textProps is "normal
behavior"
On Jan 07, 2006, at 8:43 PM, Ken Ray wrote:
> However, if you clear out the text attributes of the
> text by selecting it all and setting the textSize to empty (as you
> have
> done), you now allow normal inheritance to continue, and the
> textSize can
> now be inherited from the field itself.
What doesn't make sense is that in fact the above does not *really*
work.. or rather, it works only "momentarily."
try the following and you will see what I mean:
1) make new stack
2) create fld "field1"
3) create fld "field2"
4) from msg:
put "Fly with Rev--Free at Last!" into fld field1
put "Fly with Rev--Free at Last!" into fld field2
5) make button1 "set Size"
on mouseup
set the textsize of fld Field1 to 18
set the textsize of fld field2 to 18
end mouseup
test: it works.. as expected... text in both fields changes to 18 pt
Now:
6) manually select the text of fld field2 and set the font size to 12.
7) now click button "set size"; Text of field2 retains it's 12 pt
size. Normal behavior. As expected, the chunk was manually set and
therefore retains it's font size...
8) make new button2: "clear size"
on mouseup
set the textsize of the selectedtext to empty
end mouseup
Make sure it's traversal on is set to false; select the text of fld
field2 and click "clear size" and it will change to 18 point. As
expected... it inherits the prop we set with btn 1 above. And you are
thinking "See, yep, it works as expected..."
"But wait.. . there's more!"
Enter the green gremlin :-) :
9) edit script of btn "set size" change the point size to 12
on mouseUp
set the textsize of fld Field1 to 12
set the textsize of fld field2 to 12
end mouseUp
click that button again... note this time field2 retains the point
size of 18... i.e. even though we had just a moment ago set the
textsize of the text itself to empty, it now longer inherits the
textsize of the fld as set by script as it did when we started. It
work at stage 5) above.
Having "touched" the prop of the chunk, just once, it no longer
behaves as expected, even having set the prop to empty.
So, question remains: how to get the field and the text inside it
back to its original "pristine" state, where the cmd "set the
textsize of fld field2 to 12" will be effective?
Of course Sarah's work around will work
set the textsize of fld da to tSize
set the textsize of char 1 to char -1 of fld da to tSize
but it begs the question
Sivakatirswami
More information about the use-livecode
mailing list