Hi,
"The formattedWidth" function seems to produce not reliable results...
or am I wrong?
I have a system with 2 main stacks, one is the app (built) and a data
stack. Each stack has 2 substacks.
stack ONE (the App)
dictionary
help
stack TWO
dictionaryTwo
notesTwo
in stack TWO, I want to show a card of "dictionaryTwo" above the
current text with a click on special words (as in the RunRev
documentation).
So I have a handler in the app to set the format of the substack and the
fld :
< go invisible to the card before calling the handler>
on setStackFormat stackName,cardName,fldName
set the dontWrap of fld fldName of stack stackName to false
put the formattedWidth of fld fldName of card cardName of stack
stackName
set the width of fld fldName of card cardName of stack stackName\
to the formattedWidth of fld fldName of card cardName of stack
stackName
set the width of stack stackName \
to the formattedWidth of fld fldName of card cardName of stack
stackName
set the height of fld fldName of card cardName of stack stackName\
to the formattedHeight of fld fldName of card cardName of stack
stackName
set the height of stack stackName \
to the formattedHeight of fld fldName of card cardName of stack
stackName
set the topleft of fld fldName of card cardName of stack stackName to
"0,0"
end setStackFormat
< show stack after that>
(the fld "fldName" is the only one on the substack, is grouped and has
bg behavior. )
It works, BUT....
The width is not ALLWAYS correctly set.
When I call a fld with a long url, the width is ok, and the width of the
fld called by the subsequent clic has the same width...
But when I first call a fld with ordinary text, the width set for it is
the width set for the second call made for another fld EVEN if that fld
has a long string with no spaces.
In other words, my handler is not really efficient. And I don't
understand why.
have you some idea about that?
**** for Jeanne De Voto ?
The DOC says:
"If you specify a card or group, the formattedWidth reports the width
of a rectangle that includes all objects in that card or group, bot
visible and invisible."
....
"If you specify a field, the formattedWidth reports the width required
by the field text. "
So, when calling "the formattedWidth" AFTER going to THE CARD, and AFTER
having set the dontWrap to false, I would normally get the correct
width for the fld on THAT CARD everyway? Or am I wrong? Or my handler?
(I DO specify each time .."of card cardName of stack stackname..." for
test,but I know that's not necessary, because at this point "we are" ON
the specified card of the specified stack)
Regards
[EMAIL PROTECTED]
PBook G3 FWire, OS X 10.1.2, Build 5P 48, 320 Mo RAM - internal HD 6
Go - external FWire la Cie 30 Go
_______________________________________________
improve-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/improve-revolution