Message Boards Message Boards

0
|
8037 Views
|
8 Replies
|
2 Total Likes
View groups...
Share
Share this post:

ScrollPosition

Posted 10 years ago

There is a MousePosition function that will return the current mouse position as an ordered pair. I'm looking for a ScrollPosition function that will return the current scroll position as an ordered pair. Does anyone know if there is one or a workaround? Thank you.

Mike

POSTED BY: Michael McCain
8 Replies

You're awesome! This will work. Thank you David!!!

POSTED BY: Michael McCain

Though I don't have a solution to "Exact", there is an approach to getting back to the same cell that you were at. This is to tag the cell with a unique CellTag and then search for that CellTag using NotebookFind. Once found, you can then do a SelectionMove to Before the Cell or After the Cell. (Also before doing such a move you generally should remove the cell tag just for good housekeeping.) I am fond of tagging... See

http://library.wolfram.com/infocenter/Conferences/7246/

from some while ago.

POSTED BY: David Reiss

Thank you Kuba. Yep, I am aware of those tokens.

To clarify, I am moving around a notebook programmatically but then when I am done I would like to come back to where I started at same cell and the same scroll position. That way I don't have to search up and down the screen. I want it to come back to the exact same position as when I left so the screen is in the exact same position as when I left and my eyes don't have to move at all.

POSTED BY: Michael McCain
Posted 10 years ago

I can partially answer your second wish, you can scroll to some places :) with FrontEndTokens:

FrontEndTokenExecute[EvaluationNotebook[], "ScrollNotebookEnd"]

other that seems to be relevant:

{"ScrollLineDown", "ScrollLineUp", "ScrollNotebookEnd", 
"ScrollNotebookStart", "ScrollPageBottom", "ScrollPageDown", 
"ScrollPageFirst", "ScrollPageLast", "ScrollPageNext", 
"ScrollPagePrevious", "ScrollPageTop", "ScrollPageUp"}
POSTED BY: Kuba Podkalicki

Thank you David.

POSTED BY: Michael McCain

There does not seem to be a ScrollPosition option for Notebook. And hunting around in various other places there does not seem to be something that is equivalent. I wonder whether there is a means of using CurrentValue in someway to get at this. But, if not, then this is a very sensible suggestion to pass on to the developers because this is clearly a form of control of the notebook that should be in the system, and should be an option to Notebook.

POSTED BY: David Reiss

Hi Paul,

No. But thank you for your response. : ) I'll clarify...

If you have a notebook with lot of content open you will see a scroll bar on the far right and bottom. I'm looking for a function that will return the current value of of the scroll bars. I'd also like to be able to set the value of the scroll bars with a function call.

In a pane, there is a ScrollPosition option which allows you to set both scroll positions to an ordered pair like {500,600}. However, I don't see an option for the entire notebook.

POSTED BY: Michael McCain
Posted 10 years ago

Do you mean this?

Dynamic[MousePosition[]]

Paul.

POSTED BY: Paul Cleary
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract