Overview

Scrolled windows are used whenever content does not fit on the screen. This can be a ../GtkTreeView, ../GtkTextView or just some widgets. It uses a ../GtkScrollBar for the horizontal and vertical direction.

screenshot.png

Style Properties

Name

Type

Default

Nick

Description

misc

scrollbar-spacing

int

DEFAULT_SCROLLBAR_SPACING

Scrollbar spacing

Number of pixels between the scrollbars and the scrolled window

Min: 0; Max: G_MAXINT

scrollbars-within-bevel

boolean

FALSE

Scrollbars within bevel

Place scrollbars within the scrolled window's bevel

Geometry

The scrollbars-within-bevel style property controls where the shadow is drawn. Here are images for both cases.

Scrollbars within bevel

scrollbars-within-bevel.png

Scrollbars outside of the bevel

scrollbars-outside-bevel.png

No shadow

The scrolled window may not have a shadow at all if the application chooses so. In this case the widget will not allocate any space based on the xthickness and ythickness.

Drawing

The ../GtkScrolledWindow just draws a shadow around the content. The shadow is drawn with a state of NORMAL and the detail string is "scrolled_window". The shadow type can be set by the application, it defaults to NONE, which means that no shadow will be drawn unless the application chooses it.

The content has its own X window (often multiple nested).

GTK+ API Documentation

http://library.gnome.org/devel/gtk/stable/GtkScrolledWindow.html


How to add enclosing border to a GtkScrolledWindow:

style "my-scrolledwindow"
{
    xthickness = 10
    ythickness = 10
    GtkScrolledWindow ::scrollbars-within-bevel = 1
    GtkScrolledWindow ::scrollbar-spacing = 10
    engine "pixmap"
    {
          image
          {
                function = SHADOW
                file = "background.png"
                border = {10, 10, 10, 10}
                detail = "scrolled_window"
          }
    }
}
 
class "GtkScrolledWindow" style "my-scrolledwindow"

Attic/GnomeArt/Tutorials/GtkThemes/GtkScrolledWindow (last edited 2013-11-27 14:33:57 by WilliamJonMcCann)