Next: , Previous: Frame Parameters, Up: Frames

21.12 Scroll Bars

On graphical displays, there is a scroll bar on the side of each Emacs window. Clicking Mouse-1 on the scroll bar's up and down buttons scrolls the window by one line at a time. Clicking Mouse-1 above or below the scroll bar's inner box scrolls the window by nearly the entire height of the window, like M-v and C-v respectively (see Moving Point). Dragging the inner box scrolls continuously.

If Emacs is compiled on the X Window System without X toolkit support, the scroll bar behaves differently. Clicking Mouse-1 anywhere on the scroll bar scrolls forward like C-v, while Mouse-3 scrolls backward like M-v. Clicking Mouse-2 in the scroll bar lets you drag the inner box up and down.

To toggle the use of scroll bars, type M-x scroll-bar-mode. This command applies to all frames, including frames yet to be created. To toggle scroll bars for just the selected frame, use the command M-x toggle-scroll-bar.

To control the use of scroll bars at startup, customize the variable scroll-bar-mode. Its value should be either right (put scroll bars on the right side of windows), left (put them on the left), or nil (disable scroll bars). By default, Emacs puts scroll bars on the right if it was compiled with GTK+ support on the X Window System, and on MS-Windows or Mac OS; Emacs puts scroll bars on the left if compiled on the X Window System without GTK+ support (following the old convention for X applications).

You can also use the X resource ‘verticalScrollBars’ to enable or disable the scroll bars (see Resources). To control the scroll bar width, change the scroll-bar-width frame parameter (see Frame Parameters).