Saving the scroll position in a scrolling list field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Saving the scroll position in a scrolling list field
Hi,
I've got a scrollling list field of items on Card A which when an item is tapped, navigates to a linked different card, ie a simple notes app.
As the scrolling list field now contains over a 100 items I was wanting to see if I could code returning to the same item, ie the same position in the scrolling list field, that was tapped when navigating back to card A from another card.
I was hoping the 'thumbposition' command might help but on checking the dictionary and despite this with some trial error, I don't think this is the correct command as I can't seem to put the 'thumbposition' into a variable that I can then reference, to return to a particular position in card A.
It might not even be possible but I just wanted to check!
Many thanks,
Glenn
I've got a scrollling list field of items on Card A which when an item is tapped, navigates to a linked different card, ie a simple notes app.
As the scrolling list field now contains over a 100 items I was wanting to see if I could code returning to the same item, ie the same position in the scrolling list field, that was tapped when navigating back to card A from another card.
I was hoping the 'thumbposition' command might help but on checking the dictionary and despite this with some trial error, I don't think this is the correct command as I can't seem to put the 'thumbposition' into a variable that I can then reference, to return to a particular position in card A.
It might not even be possible but I just wanted to check!
Many thanks,
Glenn
Re: Saving the scroll position in a scrolling list field
Hi Glenn
I think you might be looking for the vScroll property, rather than the thumbposition.
I hope that helps.
Elanor
I think you might be looking for the vScroll property, rather than the thumbposition.
I hope that helps.
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Saving the scroll position in a scrolling list field
I would have thought the best idea would be to SAVE the stack just before it navigates to the new card, thereby
preserving the scrollBar at the position it is before going to the new card.
- -
Here's the code in my scrolling list field:
preserving the scrollBar at the position it is before going to the new card.
- -
Here's the code in my scrolling list field:
Code: Select all
on mouseUp
save stack "SHUFFLE"
put the selectedLine of me into ZZZ
set the itemDelimiter to " "
put item 2 of ZZZ into XXX
put line XXX of fld "scf" into KARD
go to card KARD
end mouseUp
- Attachments
-
- SHUFFLE.livecode.zip
- (1.17 KiB) Downloaded 191 times
Re: Saving the scroll position in a scrolling list field
Thanks Elanor, that works perfectly!
I've used on card A:
and on card B:
I never ceased to be amazed at how straightforward LC can be, especially for me as a beginner!
Kind regards,
Glenn
I've used on card A:
Code: Select all
put the vScroll of field 1 into gScrollPosition
and on card B:
Code: Select all
set the vScroll of field 1 of card A to gScrollPosition
Kind regards,
Glenn
Re: Saving the scroll position in a scrolling list field
Hi Richmond,
Thanks for the stack, I'll put your solution into my toolbox as well...
Regards,
Glenn
Thanks for the stack, I'll put your solution into my toolbox as well...
Regards,
Glenn
Re: Saving the scroll position in a scrolling list field
Saving the stack is of course no option in a runtime!
Re: Saving the scroll position in a scrolling list field
Sheeeeeeeeesh... 
Noone likes wise guys, Sir!

Noone likes wise guys, Sir!
Re: Saving the scroll position in a scrolling list field
Where do you live again? 

-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Saving the scroll position in a scrolling list field
Probably somewhere near the bag end of Lake Michigan, I imagine. 

Re: Saving the scroll position in a scrolling list field
Ah, good for you. 
