Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::Layout Class Reference

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

`#include <inti/gtk/layout.h>`

Inheritance diagram for Inti::Gtk::Layout:

List of all members.

## Public Member Functions

Constructors

- Layout ()
    Construct a new Layout with default horizontal and vertical adjustments.
- Layout (Adjustment *hadjustment, Adjustment *vadjustment)
    Construct a new Layout with the specified horizontal and vertical adjustments.
- virtual ~Layout ()
    Destructor.

Accessors

- GtkLayout * gtk_layout () const
    Get a pointer to the GtkLayout structure.
- GtkLayoutClass * gtk_layout_class () const
    Get a pointer to the GtkLayoutClass structure.
- operator GtkLayout * () const
    Conversion operator; safely converts a Layout to a GtkLayout pointer.
- Gdk::Window * bin_window () const
    Returns the Gdk::Window to draw to in response to an expose event.
- void 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()).
- Adjustment * get_hadjustment () const
    Get the Adjustment for the horizontal position.
- Adjustment * get_vadjustment () const
    Get the Adjustment for the vertical position.

Methods

- void 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.
- void move (Widget &child_widget, int x, int y)
    Move a current child of the Layout to a new position.
- void set_size (unsigned int width, unsigned int height)
    Sets the size of the scrollable area of the layout.
- void set_hadjustment (Adjustment *adjustment)
    Sets the horizontal scroll adjustment for the layout.
- void set_vadjustment (Adjustment *adjustment)
    Sets the vertical scroll adjustment for the layout.

Property Proxies

- const HAjustmentPropertyProxy prop_hadjustment ()
    The Adjustment for the horizontal position (Adjustment* : Read / Write).
- const VAjustmentPropertyProxy prop_vadjustment ()
    The Adjustment for the vertical position (Adjustment* : Read / Write).
- const WidthPropertyProxy prop_width ()
    The width of the layout (unsigned int : Read / Write).
- const HeightPropertyProxy prop_height ()
    The height of the layout (unsigned int : Read / Write).

Child Property Proxies

- const XPropertyProxy prop_x ()
    X position of child widget (int : Read / Write).
- const YPropertyProxy prop_y ()
    Y position of child widget (int : Read / Write).

Signal Proxies

- const SetScrollAdjustmentsSignalProxy sig_set_scroll_adjustments ()
    Connect to the set_scroll_adjustments_signal; emitted when a layout is added to a scrolling aware parent.

## Protected Member Functions

Constructors

- Layout (GtkLayout *layout, bool reference=false)
    Construct a new Layout from an existing GtkLayout.

Signal Handlers

- virtual void on_set_scroll_adjustments (Adjustment *hadjustment, Adjustment *vadjustment)
    Called when a layout is added to a scrolling aware parent.

## 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.

## Constructor & Destructor Documentation

Inti::Gtk::Layout::Layout | ( | GtkLayout * | layout,
|  | bool | reference = false
| ) | `[explicit, protected]`

  | Construct a new Layout from an existing GtkLayout. Parameters:
  layout | A pointer to a GtkLayout.
  reference | Set 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).

Inti::Gtk::Layout::Layout | ( | Adjustment * | hadjustment,
|  | Adjustment * | vadjustment
| ) |

  | Construct a new Layout with the specified horizontal and vertical adjustments. Parameters:
  hadjustment | The Adjustment for the horizontal position.
  vadjustment | The Adjustment for the vertical position.

## Member Function Documentation

Gdk::Window* Inti::Gtk::Layout::bin_window | ( |  | ) | const

| Returns the Gdk::Window to draw to in response to an expose event. Note layout widgets should not draw to Gtk::Widget::get_window().

Adjustment* Inti::Gtk::Layout::get_hadjustment | ( |  | ) | const

| 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 Inti::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:
  width | The location to store the width set on layout, or null.
  height | The location to store the height set on layout, or null.

Adjustment* Inti::Gtk::Layout::get_vadjustment | ( |  | ) | const

| 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 Inti::Gtk::Layout::move | ( | Widget & | child_widget,
|  | int | x,
|  | int | y
| ) |

  | Move a current child of the Layout to a new position. Parameters:
  child_widget | The child of the Layout to move.
  x | The X position to move to.
  y | The Y position to move to.

virtual void Inti::Gtk::Layout::on_set_scroll_adjustments | ( | Adjustment * | hadjustment,
|  | Adjustment * | vadjustment
| ) | `[protected, virtual]`

  | Called when a layout is added to a scrolling aware parent. Parameters:
  hadjustment | The horizontal adjustment.
  vadjustment | The vertical adjustment.

void Inti::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_widget | The child widget to add.
  x | The X position of child widget.
  y | The Y position of child widget.

void Inti::Gtk::Layout::set_hadjustment | ( | Adjustment * | adjustment | ) |

  | Sets the horizontal scroll adjustment for the layout. Parameters:
  adjustment | The new horizontal scroll adjustment.
See ScrolledWindow, Scrollbar, Adjustment for details.

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

  | Sets the size of the scrollable area of the layout. Parameters:
  width | The width of entire scrollable area.
  height | The height of entire scrollable area.

void Inti::Gtk::Layout::set_vadjustment | ( | Adjustment * | adjustment | ) |

  | Sets the vertical scroll adjustment for the layout. Parameters:
  adjustment | The new vertical scroll adjustment.
See ScrolledWindow, Scrollbar, Adjustment for details.

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

- gtk/layout.h

Main Page - Footer