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'].


KeywordDefinitionValue
valueInitial position of the thumbDefault is 0
rangeThe (min, max) range of the thumbDefault is (0, 1)
pageSizeThe 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 TrueDefault is 0.1
scrollSizeThe amount to move the thumb when the user clicks once on either scroll buttonDefault is 0.01
orientationThe orientation of the scroll barHORIZONTAL or VERTICAL
manageButtonsWhether to automatically adjust the buttons when the scroll bar's frame is changedTrue or False
resizeThumbWhether to adjust the width of the thumb to reflect the ratio of pageSize to the overall range; requires manageButtons to be True as wellTrue or False
commandFunction called when the position of the thumb changes (takes no arguments)Function
extraArgsExtra 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 thumbAny parameters appropriate to DirectButton
incButton_geom, incButton_relief, incButton_text, incButton_frameSize, etc.Parameters to control the look of the lower or right scroll buttonAny parameters appropriate to DirectButton
decButton_geom, decButton_relief, decButton_text, decButton_frameSize, etc.Parameters to control the look of the upper or left scroll buttonAny parameters appropriate to DirectButton
  <<prev top next>>