How to detect the scrollbar position?
#1
Hi All,

I'm hoping some-one can assist.

I'm trying to find a way from a python addon to detect the possition of a scrollbar, so I have defined the scrollbar in the window XML as:

Code:
<control type="scrollbar" id="203">
            <description>Scrollbar for Reader</description>
            <posx>1240</posx>
            <posy>60</posy>
            <width>25</width>
            <height>580</height>
            <texturesliderbackground border="0,14,0,14">ScrollBarV.png</texturesliderbackground>
            <texturesliderbar border="0,14,0,14">ScrollBarV_bar.png</texturesliderbar>
            <texturesliderbarfocus border="0,14,0,14">ScrollBarV_bar_focus.png</texturesliderbarfocus>
            <textureslidernib>ScrollBarNib.png</textureslidernib>
            <textureslidernibfocus>ScrollBarNib.png</textureslidernibfocus>
            <colordiffuse>FFCCCCCC</colordiffuse>
            <pulseonselect>True</pulseonselect>
            <orientation>vertical</orientation>
            <showonepage>true</showonepage>
            <onleft>302</onleft>
            <onright>301</onright>
        </control>

And I want to be able to work out from python at exactly what position the scrollbar is at. By this I mean how far through the text the scrollbar is (Not the physical position of the scrollbar image on the screen).

For example, I have a set of text of 1,000 lines loaded into the window, and the user has scrolled to show lines 500 to 600. How would I know that is where they are in the document from a python script?

Any suggestions or help would be brilliant!

Thanks

Rob
Reply

Logout Mark Read Team Forum Stats Members Help
How to detect the scrollbar position?0