Field Scroll Problem
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller
-
- Livecode Opensource Backer
- Posts: 42
- Joined: Thu Jan 04, 2007 8:05 pm
- Location: Maryland, USA
Field Scroll Problem
I needed to enlarge a a Field and it’s Text in my stack. I used the Fields Basic Properties - Size & Position and Text Formatting - menu options to do so.
BUT now when I enter text from a script or open the stack the field scrolls to the top vs stay at the end of the entry.
Text entered from a script enters the last line of rge field correctly.
What am I missing?
BUT now when I enter text from a script or open the stack the field scrolls to the top vs stay at the end of the entry.
Text entered from a script enters the last line of rge field correctly.
What am I missing?
"Do the right thing and everything else will take care of it's self."
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: Field Scroll Problem
That is the default for a text fld, to scroll to the top. If you need the fld to scroll to the bottom. You can change it by setting the vScoll of the fld.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- Livecode Opensource Backer
- Posts: 42
- Joined: Thu Jan 04, 2007 8:05 pm
- Location: Maryland, USA
Re: Field Scroll Problem
I tried- set the vScroll of field "Play Result" to bottom -with no effect?
"Do the right thing and everything else will take care of it's self."
Re: Field Scroll Problem
I think what you'd be looking for would be more like this -
6.5 Dictionary for vscroll, comments section wrote: kspieldenner - 2010-02-02 at 15:43:49
-------------------------------------------------------------------------------
Scroll to the bottom of a field, accounting for size of font...
set the vscroll of fld "fData" to (the effective textheight of fld "fData") * (the number of lines in fld "fData")

-
- VIP Livecode Opensource Backer
- Posts: 7583
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Field Scroll Problem
Or you can set the scroll of the field to 10000000. That ought to be enough.
Craig Newman
Craig Newman
Re: Field Scroll Problem
Googolplex, it is the only way to be sure 
Just kidding, there are a lot of ways you can do it, or even fake it a bit.

Just kidding, there are a lot of ways you can do it, or even fake it a bit.

-
- Livecode Opensource Backer
- Posts: 42
- Joined: Thu Jan 04, 2007 8:05 pm
- Location: Maryland, USA
Re: Field Scroll Problem
Craig,
Tried all three of above vie Message Box entry - still doesn't does't work
Tried all three of above vie Message Box entry - still doesn't does't work

"Do the right thing and everything else will take care of it's self."
-
- VIP Livecode Opensource Backer
- Posts: 2582
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Field Scroll Problem
As Craig said
Which LC version do you use ?
Best regards
Jean-Marc
Doesn't work ?set the vscroll of fld 1 to 100000000
put the vscroll of fld 1
Which LC version do you use ?
Best regards
Jean-Marc
-
- Livecode Opensource Backer
- Posts: 42
- Joined: Thu Jan 04, 2007 8:05 pm
- Location: Maryland, USA
Re: Field Scroll Problem
I use LiveCode Version 7.1 Community
"Do the right thing and everything else will take care of it's self."
-
- Livecode Opensource Backer
- Posts: 42
- Joined: Thu Jan 04, 2007 8:05 pm
- Location: Maryland, USA
Re: Field Scroll Problem
Jean-Marc,
Ulps
Need to test your suggestion BEFORE I answered.
Ulps

"Do the right thing and everything else will take care of it's self."
-
- Livecode Opensource Backer
- Posts: 42
- Joined: Thu Jan 04, 2007 8:05 pm
- Location: Maryland, USA
Re: Field Scroll Problem
Tried it;
set the vscroll of fld “Play Result” to 100000000
put the vscroll of fld “Play Result”
And got;
Script compile error:
Error description: set: missing 'to'
set the vscroll of fld “Play Result” to 100000000
put the vscroll of fld “Play Result”
And got;
Script compile error:

Error description: set: missing 'to'
"Do the right thing and everything else will take care of it's self."
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Field Scroll Problem
Don't use smart quotes. Use ordinary quotes:set the vscroll of fld “Play Result” to 100000000
set the vscroll of fld "Play Result" to 100000000
shiftLock happens
-
- Livecode Opensource Backer
- Posts: 42
- Joined: Thu Jan 04, 2007 8:05 pm
- Location: Maryland, USA
Re: Field Scroll Problem
set the vscroll of cd fld "Play Result" to 10000000
put the vscroll of cd fld "Play Result"
Works without an entry error BUT after data into the field, it still returns to the top line
vScroll = 0
BTW - I am usung OS X
put the vscroll of cd fld "Play Result"
Works without an entry error BUT after data into the field, it still returns to the top line

vScroll = 0


BTW - I am usung OS X
"Do the right thing and everything else will take care of it's self."
-
- VIP Livecode Opensource Backer
- Posts: 2582
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Field Scroll Problem
Yes. I think that is what is expected.BUT after data into the field, it still returns to the top line
What about this to display the end of text
Code: Select all
put myData into fld "Play Result"
set the vscroll of fld "Play Result" to 10000000
I guess you're an hypercard baby (there is no cd fields in LC, only fields)cd fld
Re: Field Scroll Problem
Just curious, did you try the script I posted above from the dictionary? Because that seems to be exactly what you are looking for as far as I can tell.
I made a test stack, 2 cards, a scrolling field named "Field" on the first, and a regular label on the second with the default name.
I put this code into the stack -
When I click on the card, it switched between the two cards, when it switched back to the scrolling field card, that field was always at the bottom regardless of whether text was added manually or by script to either the top or bottom of the field.
Unless I'm missing the point, isn't that what your trying to do?
I made a test stack, 2 cards, a scrolling field named "Field" on the first, and a regular label on the second with the default name.
I put this code into the stack -
Code: Select all
on openCard
get the childControlNames of this card
if it is "Field" then
put "this new text is added by script" & cr after field "Field"
set the vscroll of field "Field" to (the effective textheight of field "Field") * (the number of lines in field "Field")
end if
end openCard
on mouseUp
go to the next card
end mouseUp
Unless I'm missing the point, isn't that what your trying to do?
