logo top
Main Page   Widgets   Namespaces   Book  

Gtk::Toolbar Class Reference
[WidgetsContainer WidgetsToolbar classes]

Inheritance diagram for Gtk::Toolbar:

Inheritance graph
[legend]
List of all members.

Detailed Description

Bars of buttons and other widgets.

The STL-style container is available via the tools() method.


Public Types

typedef Toolbar_Helpers::ToolList ToolList
typedef Toolbar_Helpers::Callback0 Callback0

Public Member Functions

virtual ~Toolbar ()
GtkToolbar* gobj ()
 Provides access to the underlying C GtkObject.

const GtkToolbar* gobj () const
 Provides access to the underlying C GtkObject.

 Toolbar ()
void insert (ToolItem& item, int pos)
 Insert a Gtk::ToolItem into the toolbar at position pos .

void append (ToolItem& item)
void prepend (ToolItem& item)
int get_item_index (const ToolItem& item)
 Returns the position of item on the toolbar, starting from 0.

int get_n_items () const
 Returns the number of items on the toolbar.

ToolItemget_nth_item (int n)
 Returns the n <!-- -->'s item on toolbar , or 0 if the toolbar does not contain an n <!-- -->'th item.

const ToolItemget_nth_item (int n) const
 Returns the n <!-- -->'s item on toolbar , or 0 if the toolbar does not contain an n <!-- -->'th item.

bool get_show_arrow () const
 Returns whether the toolbar has an overflow menu.

void set_show_arrow (bool show_arrow=true)
 Sets whether to show an overflow menu when toolbar doesn't have room for all items on it.

void set_orientation (Orientation orientation)
 Sets whether a toolbar should appear horizontally or vertically.

Orientation get_orientation () const
 Retrieves the current orientation of the toolbar.

void set_toolbar_style (ToolbarStyle style)
 Alters the view of toolbar to display either icons only, text only, or both.

ToolbarStyle get_toolbar_style () const
 Retrieves whether the toolbar has text, icons, or both .

void set_tooltips (bool enable=true)
 Sets if the tooltips of a toolbar should be active or not.

bool get_tooltips () const
 Retrieves whether tooltips are enabled.

void set_icon_size (IconSize icon_size)
 This function sets the size of stock icons in the toolbar.

IconSize get_icon_size () const
 Retrieves the icon size fo the toolbar.

void unset_toolbar_style ()
 Unsets a toolbar style set with set_style(), so that user preferences will be used to determine the toolbar style.

void unset_icon_size ()
 Unsets toolbar icon size set with set_icon_size(), so that user preferences will be used to determine the icon size.

ReliefStyle get_relief_style () const
 Returns the relief style of buttons on toolbar .

int get_drop4_index (int x, int y) const
 Returns the position corresponding to the indicated point on toolbar .

void set_drop_highlight_item (ToolItem& tool_item, int index)
 Highlights toolbar to give an idea of what it would look like if item was added to toolbar at position indicated by index .

void unset_drop_highlight_item ()
ToolListtools ()
 STL-style container.

const ToolListtools () const
 STL-style container.

Gtk::Widgetappend_item (const Glib::ustring& text, const Glib::ustring& tooltip_text, const Glib::ustring& tooltip_private_text, Gtk::Widget& icon, Callback0 slot)
Gtk::Widgetappend_item (const Glib::ustring& text, const Glib::ustring& tooltip_text, const Glib::ustring& tooltip_private_text, Callback0 slot)
Gtk::Widgetprepend_item (const Glib::ustring& text, const Glib::ustring& tooltip_text, const Glib::ustring& tooltip_private_text, Gtk::Widget& icon, Callback0 slot)
Gtk::Widgetprepend_item (const Glib::ustring& text, const Glib::ustring& tooltip_text, const Glib::ustring& tooltip_private_text, Callback0 slot)
Gtk::Widgetinsert_item (const Glib::ustring& text, const Glib::ustring& tooltip_text, const Glib::ustring& tooltip_private_text, Gtk::Widget& icon, Callback0 slot, int position)
Gtk::Widgetinsert_item (const Glib::ustring& text, const Glib::ustring& tooltip_text, const Glib::ustring& tooltip_private_text, Callback0 slot, int position)
Gtk::Widgetinsert_stock (const Gtk::StockID& stock_id, const Glib::ustring& tooltip_text, const Glib::ustring& tooltip_private_text, Callback0 slot, int position)
void append_space ()
 Adds a new space to the end of the toolbar.

void prepend_space ()
 Adds a new space to the beginning of the toolbar.

void insert_space (int position)
 Inserts a new space in the toolbar at the specified position.

void remove_space (int position)
 Removes a space from the specified position.

void append_widget (Gtk::Widget& widget, const Glib::ustring& tooltip_text=Glib::ustring(), const Glib::ustring& tooltip_private_text=Glib::ustring())
 Adds a widget to the end of the given toolbar.

void prepend_widget (Gtk::Widget& widget, const Glib::ustring& tooltip_text=Glib::ustring(), const Glib::ustring& tooltip_private_text=Glib::ustring())
 Adds a widget to the beginning of the given toolbar.

void insert_widget (Gtk::Widget& widget, const Glib::ustring& tooltip_text, const Glib::ustring& tooltip_private_text, int position)
 Inserts a widget in the toolbar at the given position.

Glib::SignalProxy1< void,
Orientation
signal_orientation_changed ()
Glib::SignalProxy1< void,
ToolbarStyle
signal_toolbar_style_changed ()
Glib::SignalProxy3< bool,
int, int, int > 
signal_popup_context_menu ()
Glib::PropertyProxy<Orientationproperty_orientation ()
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Glib::PropertyProxy_ReadOnly<
Orientation
property_orientation () const
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Glib::PropertyProxy<ToolbarStyleproperty_toolbar_style ()
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Glib::PropertyProxy_ReadOnly<
ToolbarStyle
property_toolbar_style () const
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Glib::PropertyProxy<bool> property_show_arrow ()
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Glib::PropertyProxy_ReadOnly<
bool > 
property_show_arrow () const
 You rarely need to use properties because there are get_ and set_ methods for almost all of them.


Protected Types

typedef std::auto_ptr<Toolbar_Helpers::ToolListtools_proxy_ptr_type

Protected Member Functions

virtual void on_orientation_changed (Orientation orientation)
virtual void on_toolbar_style_changed (ToolbarStyle style)
virtual bool on_popup_context_menu (int x, int y, int button_number)

Protected Attributes

tools_proxy_ptr_type tools_proxy_

Related Functions

(Note that these are not member functions.)

Gtk::Toolbarwrap (GtkToolbar* object, bool take_copy=false)


Member Typedef Documentation

typedef Toolbar_Helpers::Callback0 Gtk::Toolbar::Callback0
 

typedef Toolbar_Helpers::ToolList Gtk::Toolbar::ToolList
 

typedef std::auto_ptr<Toolbar_Helpers::ToolList> Gtk::Toolbar::tools_proxy_ptr_type [protected]
 


Constructor & Destructor Documentation

virtual Gtk::Toolbar::~Toolbar (  )  [virtual]
 

Gtk::Toolbar::Toolbar (  ) 
 


Member Function Documentation

void Gtk::Toolbar::append ( ToolItem item  ) 
 

Gtk::Widget* Gtk::Toolbar::append_item ( const Glib::ustring text,
const Glib::ustring tooltip_text,
const Glib::ustring tooltip_private_text,
Callback0  slot
 

Gtk::Widget* Gtk::Toolbar::append_item ( const Glib::ustring text,
const Glib::ustring tooltip_text,
const Glib::ustring tooltip_private_text,
Gtk::Widget icon,
Callback0  slot
 

void Gtk::Toolbar::append_space (  ) 
 

Adds a new space to the end of the toolbar.

void Gtk::Toolbar::append_widget ( Gtk::Widget widget,
const Glib::ustring tooltip_text = Glib::ustring(),
const Glib::ustring tooltip_private_text = Glib::ustring()
 

Adds a widget to the end of the given toolbar.

Parameters:
widget A Gtk::Widget to add to the toolbar.
tooltip_text The element's tooltip.
tooltip_private_text Used for context-sensitive help about this toolbar element.

int Gtk::Toolbar::get_drop4_index ( int  x,
int  y
const
 

Returns the position corresponding to the indicated point on toolbar .

This is useful when dragging items to the toolbar: this function returns the position a new item should be inserted.

x and y are in toolbar coordinates.

Parameters:
x X coordinate of a point on the toolbar.
y Y coordinate of a point on the toolbar.
Returns:
The position corresponding to the point ( x , y ) on the toolbar.
Since: 2.4.

IconSize Gtk::Toolbar::get_icon_size (  )  const
 

Retrieves the icon size fo the toolbar.

See set_icon_size().

Returns:
The current icon size for the icons on the toolbar.

int Gtk::Toolbar::get_item_index ( const ToolItem item  ) 
 

Returns the position of item on the toolbar, starting from 0.

It is an error if item is not a child of the toolbar.

Parameters:
item A Gtk::ToolItem that is a child of toolbar .
Returns:
The position of item on the toolbar.
Since: 2.4.

int Gtk::Toolbar::get_n_items (  )  const
 

Returns the number of items on the toolbar.

Returns:
The number of items on the toolbar
Since: 2.4.

const ToolItem* Gtk::Toolbar::get_nth_item ( int  n  )  const
 

Returns the n <!-- -->'s item on toolbar , or 0 if the toolbar does not contain an n <!-- -->'th item.

Parameters:
n A position on the toolbar.
Returns:
The n <!-- -->'th Gtk::ToolItem on toolbar , or 0 if there isn't an n <!-- -->th item.
Since: 2.4.

ToolItem* Gtk::Toolbar::get_nth_item ( int  n  ) 
 

Returns the n <!-- -->'s item on toolbar , or 0 if the toolbar does not contain an n <!-- -->'th item.

Parameters:
n A position on the toolbar.
Returns:
The n <!-- -->'th Gtk::ToolItem on toolbar , or 0 if there isn't an n <!-- -->th item.
Since: 2.4.

Orientation Gtk::Toolbar::get_orientation (  )  const
 

Retrieves the current orientation of the toolbar.

See set_orientation().

Returns:
The orientation.

ReliefStyle Gtk::Toolbar::get_relief_style (  )  const
 

Returns the relief style of buttons on toolbar .

See gtk_button_set_relief_style().

Returns:
The relief style of buttons on toolbar .
Since: 2.4.

bool Gtk::Toolbar::get_show_arrow (  )  const
 

Returns whether the toolbar has an overflow menu.

See set_show_arrow()

Returns:
Since: 2.4.

ToolbarStyle Gtk::Toolbar::get_toolbar_style (  )  const
 

Retrieves whether the toolbar has text, icons, or both .

See set_style().

Returns:
The current style of toolbar .

bool Gtk::Toolbar::get_tooltips (  )  const
 

Retrieves whether tooltips are enabled.

See set_tooltips().

Returns:
true if tooltips are enabled.

const GtkToolbar* Gtk::Toolbar::gobj (  )  const [inline]
 

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

GtkToolbar* Gtk::Toolbar::gobj (  )  [inline]
 

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

void Gtk::Toolbar::insert ( ToolItem item,
int  pos
 

Insert a Gtk::ToolItem into the toolbar at position pos .

If pos is 0 the item is prepended to the start of the toolbar. If pos is negative, the item is appended to the end of the toolbar.

Since: 2.4

Parameters:
item A Gtk::ToolItem.
pos The position of the new item.

Gtk::Widget* Gtk::Toolbar::insert_item ( const Glib::ustring text,
const Glib::ustring tooltip_text,
const Glib::ustring tooltip_private_text,
Callback0  slot,
int  position
 

Gtk::Widget* Gtk::Toolbar::insert_item ( const Glib::ustring text,
const Glib::ustring tooltip_text,
const Glib::ustring tooltip_private_text,
Gtk::Widget icon,
Callback0  slot,
int  position
 

void Gtk::Toolbar::insert_space ( int  position  ) 
 

Inserts a new space in the toolbar at the specified position.

Parameters:
position The number of widgets after which a space should be inserted.

Gtk::Widget* Gtk::Toolbar::insert_stock ( const Gtk::StockID stock_id,
const Glib::ustring tooltip_text,
const Glib::ustring tooltip_private_text,
Callback0  slot,
int  position
 

void Gtk::Toolbar::insert_widget ( Gtk::Widget widget,
const Glib::ustring tooltip_text,
const Glib::ustring tooltip_private_text,
int  position
 

Inserts a widget in the toolbar at the given position.

Parameters:
widget A Gtk::Widget to add to the toolbar.
tooltip_text The element's tooltip.
tooltip_private_text Used for context-sensitive help about this toolbar element.
position The number of widgets to insert this widget after.

virtual void Gtk::Toolbar::on_orientation_changed ( Orientation  orientation  )  [protected, virtual]
 

virtual bool Gtk::Toolbar::on_popup_context_menu ( int  x,
int  y,
int  button_number
[protected, virtual]
 

virtual void Gtk::Toolbar::on_toolbar_style_changed ( ToolbarStyle  style  )  [protected, virtual]
 

void Gtk::Toolbar::prepend ( ToolItem item  ) 
 

Gtk::Widget* Gtk::Toolbar::prepend_item ( const Glib::ustring text,
const Glib::ustring tooltip_text,
const Glib::ustring tooltip_private_text,
Callback0  slot
 

Gtk::Widget* Gtk::Toolbar::prepend_item ( const Glib::ustring text,
const Glib::ustring tooltip_text,
const Glib::ustring tooltip_private_text,
Gtk::Widget icon,
Callback0  slot
 

void Gtk::Toolbar::prepend_space (  ) 
 

Adds a new space to the beginning of the toolbar.

void Gtk::Toolbar::prepend_widget ( Gtk::Widget widget,
const Glib::ustring tooltip_text = Glib::ustring(),
const Glib::ustring tooltip_private_text = Glib::ustring()
 

Adds a widget to the beginning of the given toolbar.

Parameters:
widget A Gtk::Widget to add to the toolbar.
tooltip_text The element's tooltip.
tooltip_private_text Used for context-sensitive help about this toolbar element.

Glib::PropertyProxy_ReadOnly<Orientation> Gtk::Toolbar::property_orientation (  )  const
 

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<Orientation> Gtk::Toolbar::property_orientation (  ) 
 

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<bool> Gtk::Toolbar::property_show_arrow (  )  const
 

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<bool> Gtk::Toolbar::property_show_arrow (  ) 
 

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<ToolbarStyle> Gtk::Toolbar::property_toolbar_style (  )  const
 

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<ToolbarStyle> Gtk::Toolbar::property_toolbar_style (  ) 
 

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::Toolbar::remove_space ( int  position  ) 
 

Removes a space from the specified position.

Parameters:
position The index of the space to remove.

void Gtk::Toolbar::set_drop_highlight_item ( ToolItem tool_item,
int  index
 

Highlights toolbar to give an idea of what it would look like if item was added to toolbar at position indicated by index .

If item is 0, highlighting is turned off. In that case index is ignored.

The tool_item passed to this function must not be part of any widget hierarchy. When an item is set as drop highlight item it can not added to any widget hierarchy or used as highlight item for another toolbar.

Since: 2.4

Parameters:
item A Gtk::ToolItem, or 0 to turn of highlighting.
index A position on toolbar .

void Gtk::Toolbar::set_icon_size ( IconSize  icon_size  ) 
 

This function sets the size of stock icons in the toolbar.

You can call it both before you add the icons and after they've been added. The size you set will override user preferences for the default icon size.

Parameters:
icon_size The Gtk::IconSize that stock icons in the toolbar shall have.

void Gtk::Toolbar::set_orientation ( Orientation  orientation  ) 
 

Sets whether a toolbar should appear horizontally or vertically.

Parameters:
orientation A new Gtk::Orientation.

void Gtk::Toolbar::set_show_arrow ( bool  show_arrow = true  ) 
 

Sets whether to show an overflow menu when toolbar doesn't have room for all items on it.

If true, items that there are not room are available through an overflow menu.

Since: 2.4

Parameters:
show_arrow Whether to show an overflow menu.

void Gtk::Toolbar::set_toolbar_style ( ToolbarStyle  style  ) 
 

Alters the view of toolbar to display either icons only, text only, or both.

Parameters:
style The new style for toolbar .

void Gtk::Toolbar::set_tooltips ( bool  enable = true  ) 
 

Sets if the tooltips of a toolbar should be active or not.

Parameters:
enable Set to false to disable the tooltips, or true to enable them.

Glib::SignalProxy1<void,Orientation> Gtk::Toolbar::signal_orientation_changed (  ) 
 

Prototype:
void orientation_changed(Orientation orientation)

Glib::SignalProxy3<bool,int,int,int> Gtk::Toolbar::signal_popup_context_menu (  ) 
 

Prototype:
bool popup_context_menu(int x, int y, int button_number)

Glib::SignalProxy1<void,ToolbarStyle> Gtk::Toolbar::signal_toolbar_style_changed (  ) 
 

Prototype:
void toolbar_style_changed(ToolbarStyle style)

const ToolList& Gtk::Toolbar::tools (  )  const
 

STL-style container.

ToolList& Gtk::Toolbar::tools (  ) 
 

STL-style container.

void Gtk::Toolbar::unset_drop_highlight_item (  ) 
 

void Gtk::Toolbar::unset_icon_size (  ) 
 

Unsets toolbar icon size set with set_icon_size(), so that user preferences will be used to determine the icon size.

void Gtk::Toolbar::unset_toolbar_style (  ) 
 

Unsets a toolbar style set with set_style(), so that user preferences will be used to determine the toolbar style.


Friends And Related Function Documentation

Gtk::Toolbar* wrap ( GtkToolbar*  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.


Member Data Documentation

tools_proxy_ptr_type Gtk::Toolbar::tools_proxy_ [mutable, protected]
 


The documentation for this class was generated from the following file:
Generated for gtkmm 2.4 by Doxygen 1.3.4 © 1997-2001