Panda3D Manual: DirectScrollBar
<<prev | top | next>> |
A DirectScrollBar is similar to the "scroll bar" widget commonly used by the user to page through a large document. DirectScrolledBar is available beginning in Panda3D 1.1. It consists of a long trough, a thumb that slides along the trough, and a pair of buttons on either side of the trough to scroll one line at a time. A DirectScrollBar can be oriented either vertically or horizontally. The DirectScrollBar is similar in function to DirectSlider, but it is specifically designed for scrolling through a large window. In fact, a pair of DirectScrollBars is used to implement the DirectScrolledFrame, which manages this scrolling functionality automatically. (Because DirectScrolledFrame exists, you will probably not need to create a DirectScrollBar directly, unless you have some custom purpose that requires a scroll bar.) DirectScrollBar has many things in common with DirectSlider. Like DirectSlider, the normal DirectGui parameters such as frameSize, geom, and relief control the look of the trough. You can control the look of the thumb by prefixing each of these parameters with the prefix "thumb_", e.g. `thumb_frameSize`; similarly, you can control the look of the two scroll buttons by prefixing these with "incButton_" and "decButton_". You can retrieve or set the current position of the thumb with `myScrollBar['value']`.
Keyword | Definition | Value
value | Initial position of the thumb | Default is 0
range | The (min, max) range of the thumb | Default is (0, 1)
pageSize | The amount to jump the thumb when the user clicks left or right of the thumb; this also controls the width of the thumb when resizeThumb is True | Default is 0.1
scrollSize | The amount to move the thumb when the user clicks once on either scroll button | Default is 0.01
orientation | The orientation of the scroll bar | HORIZONTAL or VERTICAL
manageButtons | Whether to automatically adjust the buttons when the scroll bar's frame is changed | True or False
resizeThumb | Whether to adjust the width of the thumb to reflect the ratio of pageSize to the overall range; requires manageButtons to be True as well | True or False
command | Function called when the position of the thumb changes (takes no arguments) | Function
extraArgs | Extra arguments to the function specified in command | [Extra Arguments]
thumb_geom, thumb_relief, thumb_text, thumb_frameSize, etc. | Parameters to control the look of the thumb | Any parameters appropriate to DirectButton
incButton_geom, incButton_relief, incButton_text, incButton_frameSize, etc. | Parameters to control the look of the lower or right scroll button | Any parameters appropriate to DirectButton
decButton_geom, decButton_relief, decButton_text, decButton_frameSize, etc. | Parameters to control the look of the upper or left scroll button | Any parameters appropriate to DirectButton

<<prev | top | next>> |