gtkmm 2.4: Gtk::ScrolledWindow Class Reference

Main Page Widgets Namespaces Book

# Gtk::ScrolledWindow Class Reference
[Widgets, Container Widgets]

Inheritance diagram for Gtk::ScrolledWindow:

[legend]
List of all members.

## Detailed Description

Adds scrollbars to its child widget.

This container accepts a single child widget. It adds scrollbars to the child widget and optionally draws a beveled frame around the child widget. The scrolled window can work in two ways: 1) Some widgets have native scrolling support; these widgets handle certain Gtk::Adjustment signals. Widgets with native scroll support include Gtk::TreeView, Gtk::TextView, and Gtk::Layout. 2) For widgets that lack native scrolling support, such as Gtk::Table, Gtk::Box, and so on, the widget will be placed inside a Gtk::Viewport.

The position of the scrollbars is controlled by the scroll adjustments. See Gtk::Adjustment for the fields in an adjustment - for Gtk::Scrollbar, used by Gtk::ScrolledWindow, the "value" field represents the position of the scrollbar, which must be between the "lower" field and "upper - page_size." The "page_size" field represents the size of the visible scrollable area. The "step_increment" and "page_increment" fields are used when the user asks to step down (using the small stepper arrows) or page down (using for example the PageDown key).

If a Gtk::ScrolledWindow doesn't behave quite as you would like, or doesn't have exactly the right layout, it's very possible to set up your own scrolling with Gtk::Scrollbar and, for example, a Gtk::Table.

## Public Member Functions
virtual void | add (Gtk::Widget& widget)
| Puts the child inside a Gtk::Viewport if it doesn't have native scrolling capability.
const Gtk::Adjustment* | get_hadjustment () const
Gtk::Adjustment* | get_hadjustment ()
const HScrollbar* | get_hscrollbar () const
| Returns the horizontal scrollbar of scrolled_window .
HScrollbar* | get_hscrollbar ()
| Returns the horizontal scrollbar of scrolled_window .
bool | get_hscrollbar_visible () const
CornerType | get_placement () const
| Gets the placement of the scrollbars for the scrolled window.
void | get_policy (PolicyType& hscrollbar_policy, PolicyType& vscrollbar_policy) const
| Retrieves the current policy values for the horizontal and vertical scrollbars.
ShadowType | get_shadow_type () const
| Gets the shadow type of the scrolled window.
const Gtk::Adjustment* | get_vadjustment () const
Gtk::Adjustment* | get_vadjustment ()
const VScrollbar* | get_vscrollbar () const
| Returns the vertical scrollbar of scrolled_window .
VScrollbar* | get_vscrollbar ()
| Returns the vertical scrollbar of scrolled_window .
bool | get_vscrollbar_visible () const
const GtkScrolledWindow* | gobj () const
| Provides access to the underlying C GtkObject.
GtkScrolledWindow* | gobj ()
| Provides access to the underlying C GtkObject.
Glib::PropertyProxy_ReadOnly< Gtk::Adjustment* > | property_hadjustment () const
| The GtkAdjustment for the horizontal position.
Glib::PropertyProxy<Gtk::Adjustment*> | property_hadjustment ()
| The GtkAdjustment for the horizontal position.
Glib::PropertyProxy_ReadOnly< PolicyType > | property_hscrollbar_policy () const
| When the horizontal scrollbar is displayed.
Glib::PropertyProxy<PolicyType> | property_hscrollbar_policy ()
| When the horizontal scrollbar is displayed.
Glib::PropertyProxy_ReadOnly< ShadowType > | property_shadow_type () const
| Style of bevel around the contents.
Glib::PropertyProxy<ShadowType> | property_shadow_type ()
| Style of bevel around the contents.
Glib::PropertyProxy_ReadOnly< Gtk::Adjustment* > | property_vadjustment () const
| The GtkAdjustment for the vertical position.
Glib::PropertyProxy<Gtk::Adjustment*> | property_vadjustment ()
| The GtkAdjustment for the vertical position.
Glib::PropertyProxy_ReadOnly< PolicyType > | property_vscrollbar_policy () const
| When the vertical scrollbar is displayed.
Glib::PropertyProxy<PolicyType> | property_vscrollbar_policy ()
| When the vertical scrollbar is displayed.
Glib::PropertyProxy_ReadOnly< CornerType > | property_window_placement () const
| Where the contents are located with respect to the scrollbars.
Glib::PropertyProxy<CornerType> | property_window_placement ()
| Where the contents are located with respect to the scrollbars.
| ScrolledWindow (Adjustment& hadjustment, Adjustment& vadjustment)
| ScrolledWindow ()
void | set_hadjustment (Gtk::Adjustment& hadjustment)
void | set_hadjustment (Gtk::Adjustment* hadjustment=0)
void | set_placement (CornerType window_placement)
void | set_policy (PolicyType hscrollbar_policy, PolicyType vscrollbar_policy)
void | set_shadow_type (ShadowType type)
| Changes the type of shadow drawn around the contents of scrolled_window .
void | set_vadjustment (Gtk::Adjustment& vadjustment)
void | set_vadjustment (Gtk::Adjustment* vadjustment=0)
void | unset_placement ()
virtual | ~ScrolledWindow ()
## Related Functions
(Note that these are not member functions.)
Gtk::ScrolledWindow* | wrap (GtkScrolledWindow* object, bool take_copy=false)

## Constructor & Destructor Documentation

virtual Gtk::ScrolledWindow::~ScrolledWindow | ( |  | ) | `[virtual]`

Gtk::ScrolledWindow::ScrolledWindow | ( |  | ) |

Gtk::ScrolledWindow::ScrolledWindow | ( | Adjustment& | hadjustment,
|  | Adjustment& | vadjustment |
| ) |  |  | `[explicit]`

## Member Function Documentation

virtual void Gtk::ScrolledWindow::add | ( | Gtk::Widget& | widget | ) | `[virtual]`

Puts the child inside a Gtk::Viewport if it doesn't have native scrolling capability.

Reimplemented from Gtk::Container.

const Gtk::Adjustment* Gtk::ScrolledWindow::get_hadjustment | ( |  | ) | const

Gtk::Adjustment* Gtk::ScrolledWindow::get_hadjustment | ( |  | ) |

const HScrollbar* Gtk::ScrolledWindow::get_hscrollbar | ( |  | ) | const

Returns the horizontal scrollbar of scrolled_window .

Returns:
  The horizontal scrollbar of the scrolled window, or `0` if it does not have one.

Since gtkmm 2.8:

HScrollbar* Gtk::ScrolledWindow::get_hscrollbar | ( |  | ) |

Returns the horizontal scrollbar of scrolled_window .

Returns:
  The horizontal scrollbar of the scrolled window, or `0` if it does not have one.

Since gtkmm 2.8:

bool Gtk::ScrolledWindow::get_hscrollbar_visible | ( |  | ) | const

CornerType Gtk::ScrolledWindow::get_placement | ( |  | ) | const

Gets the placement of the scrollbars for the scrolled window.

See set_placement().

Returns:
  The current placement value.

void Gtk::ScrolledWindow::get_policy | ( | PolicyType& | hscrollbar_policy,
|  | PolicyType& | vscrollbar_policy |
| ) |  |  | const

Retrieves the current policy values for the horizontal and vertical scrollbars.

See set_policy().

Parameters:

  | hscrollbar_policy | Location to store the policy for the horizontal scrollbar, or `0`.
  | vscrollbar_policy | Location to store the policy for the horizontal scrollbar, or `0`.

ShadowType Gtk::ScrolledWindow::get_shadow_type | ( |  | ) | const

Gets the shadow type of the scrolled window.

See set_shadow_type().

Returns:
  The current shadow type.

const Gtk::Adjustment* Gtk::ScrolledWindow::get_vadjustment | ( |  | ) | const

Gtk::Adjustment* Gtk::ScrolledWindow::get_vadjustment | ( |  | ) |

const VScrollbar* Gtk::ScrolledWindow::get_vscrollbar | ( |  | ) | const

Returns the vertical scrollbar of scrolled_window .

Returns:
  The vertical scrollbar of the scrolled window, or `0` if it does not have one.

Since gtkmm 2.8:

VScrollbar* Gtk::ScrolledWindow::get_vscrollbar | ( |  | ) |

Returns the vertical scrollbar of scrolled_window .

Returns:
  The vertical scrollbar of the scrolled window, or `0` if it does not have one.

Since gtkmm 2.8:

bool Gtk::ScrolledWindow::get_vscrollbar_visible | ( |  | ) | const

const GtkScrolledWindow* Gtk::ScrolledWindow::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Bin.

GtkScrolledWindow* Gtk::ScrolledWindow::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Bin.

Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> Gtk::ScrolledWindow::property_hadjustment | ( |  | ) | const

The GtkAdjustment for the horizontal position.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Gtk::Adjustment*> Gtk::ScrolledWindow::property_hadjustment | ( |  | ) |

The GtkAdjustment for the horizontal position.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<PolicyType> Gtk::ScrolledWindow::property_hscrollbar_policy | ( |  | ) | const

When the horizontal scrollbar is displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<PolicyType> Gtk::ScrolledWindow::property_hscrollbar_policy | ( |  | ) |

When the horizontal scrollbar is displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<ShadowType> Gtk::ScrolledWindow::property_shadow_type | ( |  | ) | const

Style of bevel around the contents.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<ShadowType> Gtk::ScrolledWindow::property_shadow_type | ( |  | ) |

Style of bevel around the contents.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> Gtk::ScrolledWindow::property_vadjustment | ( |  | ) | const

The GtkAdjustment for the vertical position.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Gtk::Adjustment*> Gtk::ScrolledWindow::property_vadjustment | ( |  | ) |

The GtkAdjustment for the vertical position.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<PolicyType> Gtk::ScrolledWindow::property_vscrollbar_policy | ( |  | ) | const

When the vertical scrollbar is displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<PolicyType> Gtk::ScrolledWindow::property_vscrollbar_policy | ( |  | ) |

When the vertical scrollbar is displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<CornerType> Gtk::ScrolledWindow::property_window_placement | ( |  | ) | const

Where the contents are located with respect to the scrollbars.

This property only takes effect if window-placement-set is TRUE.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<CornerType> Gtk::ScrolledWindow::property_window_placement | ( |  | ) |

Where the contents are located with respect to the scrollbars.

This property only takes effect if window-placement-set is TRUE.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::ScrolledWindow::set_hadjustment | ( | Gtk::Adjustment& | hadjustment | ) |

void Gtk::ScrolledWindow::set_hadjustment | ( | Gtk::Adjustment* | hadjustment = `0` | ) |

void Gtk::ScrolledWindow::set_placement | ( | CornerType | window_placement | ) |

void Gtk::ScrolledWindow::set_policy | ( | PolicyType | hscrollbar_policy,
|  | PolicyType | vscrollbar_policy |
| ) |  |  |

void Gtk::ScrolledWindow::set_shadow_type | ( | ShadowType | type | ) |

Changes the type of shadow drawn around the contents of scrolled_window .

Parameters:

  | type | Kind of shadow to draw around scrolled window contents.

void Gtk::ScrolledWindow::set_vadjustment | ( | Gtk::Adjustment& | vadjustment | ) |

void Gtk::ScrolledWindow::set_vadjustment | ( | Gtk::Adjustment* | vadjustment = `0` | ) |

void Gtk::ScrolledWindow::unset_placement | ( |  | ) |

## Friends And Related Function Documentation

Gtk::ScrolledWindow* wrap | ( | GtkScrolledWindow * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

Parameters:

  | object | The C instance
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- scrolledwindow.h