[comp.sys.mac.hypercard] Scrolling fields all the way

kay@warwick.UUCP (Kay Dekker) (04/02/88)

Help!
	OK, I know that what I need is sticky-buttons, but until then...
The stack I'm implementing needs to use scrolling fields, because some
of the text is longer than a cardsworth; I only want the user to be able
to access some buttons when they've scrolled all the way through the field.

OK, I thought: the scroll property of a field can be set from a script, so,
all I need is a mouseWithin handler for the field, and when the user has
scrolled onto the last 'screenful', fully scroll the field and then reveal
the buttons.

Now, how does one set the field to be fully scrolled down?

Bright Idea #1 was ``OK, if I set the scroll of the field to some huge
number, then it should scroll all the way to the bottom, and then stop''.
Wrong, apparently.
	set the scroll of card field "CardText100" to 999999
does exactly what I'd asked it to do, and (amazingly) scrolls the text 
_past_the_top_of_the_field_!

Bright Idea #2: I know the height of the text, and I can get the number of
lines in the field, right? sooo... if I set the scroll of the field to the
height*the number of lines, then that's where we want to be, right?  Wrong.
As far as I can see, the number of lines that I can get _isn't_ the actual
number of lines (in terms of occupied space), but the number of _non-blank_
lines in the field.  Now, I like to use blank lines to separate paragraphs.
Auuuugh!!

What am I doing wrong? (apart from not waiting for a version of HC with sticky
buttons).  I'm not sure what I really think setting the scroll to a huge
number _should_ do; however, I don't think the current behaviour is right.
I mean, one can't scroll past the end of a scrolling field with the scroll
bar, so I'm not happy that one can apparently do so from a script.  Probably
either my 'clipping' intention or an error would be better, I think.

#2 seems odd, too.  Am I really interpreting my results correctly? can one
only find out the number of lines with _real_ text on them?

Help! please!
							Kay

PS: I've worked through Danny Goodman's book and the Help stack; I may have
missed something Really Obvious, so please be gentle with me if I'm asking
silly questions...

"Everything is rather more like everything else than it is like itself".