Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions | Static Protected Attributes
Xfc::Gtk::Layout Class Reference

A GtkLayout C++ wrapper class. More...

#include <xfc/gtk/layout.hh>

Inheritance diagram for Xfc::Gtk::Layout:
Xfc::Gtk::Container Xfc::Gtk::Widget Xfc::Gtk::Object Xfc::Atk::Implementor Xfc::G::Object Xfc::G::TypeInterface Xfc::G::TypeInstance Xfc::G::TypeInstance Xfc::Trackable Xfc::Trackable

List of all members.

Public Member Functions

Static Protected Attributes

Constructors


Detailed Description

A GtkLayout C++ wrapper class.

Layout is similar to DrawingArea in that it's a "blank slate" and doesn't do anything but paint a blank background by default. It's different in that it supports scrolling natively (you can add it to a ScrolledWindow), and it can contain child widgets, since it's a Container. However if you're just going to draw, a DrawingArea is a better choice since it has lower overhead. When handling expose events on a Layout, you must draw to bin_window(), rather than to Gtk::Widget::get_window() as you would for a drawing area.

See also: the Layout Container HOWTO.


Constructor & Destructor Documentation

Xfc::Gtk::Layout::Layout ( GtkLayout *  layout,
bool  owns_reference = false 
) [explicit, protected]

Construct a new Layout from an existing GtkLayout.

Parameters:
layoutA pointer to a GtkLayout.
owns_referenceSet false if the initial reference count is floating, set true if it's not.

The layout can be a newly created GtkLayout or an existing GtkLayout (see G::Object::Object).

Xfc::Gtk::Layout::Layout ( Adjustment hadjustment,
Adjustment vadjustment 
)

Construct a new Layout with the specified horizontal and vertical adjustments.

Parameters:
hadjustmentThe Adjustment for the horizontal position.
vadjustmentThe Adjustment for the vertical position.

Member Function Documentation

Returns the Gdk::Window to draw to in response to an expose event.

Note layout widgets should not draw to Gtk::Widget::get_window().

Get the Adjustment for the horizontal position.

Returns:
The Adjustment used for communication between the horizontal scrollbar and layout.

This method should only be called after the layout has been placed in a ScrolledWindow or otherwise configured for scrolling (see ScrolledWindow, Scrollbar, Adjustment for details).

void Xfc::Gtk::Layout::get_size ( unsigned int *  width,
unsigned int *  height 
)

Gets the size that has been set on the layout, and that determines the total extents of the layout's scrollbar area (see set_size()).

Parameters:
widthThe location to store the width set on layout, or null.
heightThe location to store the height set on layout, or null.

Get the Adjustment for the vertical position.

Returns:
The Adjustment used for communication between the vertical scrollbar and layout.

This method should only be called after the layout has been placed in a ScrolledWindow or otherwise configured for scrolling (see ScrolledWindow, Scrollbar, Adjustment for details).

void Xfc::Gtk::Layout::move ( Widget child_widget,
int  x,
int  y 
)

Move a current child of the Layout to a new position.

Parameters:
child_widgetThe child of the Layout to move.
xThe X position to move to.
yThe Y position to move to.
void Xfc::Gtk::Layout::put ( Widget child_widget,
int  x,
int  y 
)

Add child_widget to the Layout, at position (x,y); the Layout becomes the new parent container of child_widget.

Parameters:
child_widgetThe child widget to add.
xThe X position of child widget.
yThe Y position of child widget.

Sets the horizontal scroll adjustment for the layout.

Parameters:
adjustmentThe new horizontal scroll adjustment.

See ScrolledWindow, Scrollbar, Adjustment for details.

void Xfc::Gtk::Layout::set_size ( unsigned int  width,
unsigned int  height 
)

Sets the size of the scrollable area of the layout.

Parameters:
widthThe width of entire scrollable area.
heightThe height of entire scrollable area.

Sets the vertical scroll adjustment for the layout.

Parameters:
adjustmentThe new vertical scroll adjustment.

See ScrolledWindow, Scrollbar, Adjustment for details.

Connect to the set_scroll_adjustments_signal; emitted when a layout is added to a scrolling aware parent.


Member Data Documentation

Set scroll adjustments signal (see signal_set_scroll_adjustments()).

Calls a slot with the signature:

< void function(Gtk::Adjustment *hadjustment, Gtk::Adjustment *vadjustment);
< // hadjustment: The horizontal adjustment.
< // vadjustment: The vertical adjustment.
<

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC