Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Gtk::MenuToolButton Class Reference

A GtkMenuToolButton C++ wrapper class. More...

`#include <xfc/gtk/menutoolbutton.hh>`

Inheritance diagram for Xfc::Gtk::MenuToolButton:

List of all members.

## Public Member Functions

Constructors

- MenuToolButton ()
    Constructs an empty menu tool button.
- MenuToolButton (Widget &icon_widget)
    Constructs a new menu tool button using icon_widget as the icon.
- MenuToolButton (const String &label, bool use_underline=false)
    Constructs a new menu tool button using label as the label.
- MenuToolButton (Widget &icon_widget, const String &label, bool use_underline=false)
    Constructs a new menu tool button using label as the label.
- MenuToolButton (const StockId &stock_id)
    Constructs a new menu tool button containing the image and text from a stock item.
- virtual ~MenuToolButton ()
    Destructor.

Accessors

- GtkMenuToolButton * gtk_menu_tool_button () const
    Get a pointer to the GtkMenuToolButton structure.
- operator GtkMenuToolButton * () const
    Conversion operator; safely converts an MenuToolButton to a GtkMenuToolButton pointer.
- Menu * get_menu () const
    Gets the Menu associated with the MenuToolButton.

Methods

- void set_menu (Menu *menu)
    Sets the Menu that is popped up when the user clicks on the arrow.
- void set_arrow_tooltip (Tooltips &tooltips, const String &tip_text, const String &tip_private)
    Sets the Tooltips object to be used for the arrow button which pops up the menu.

## Protected Member Functions

Constructors

- MenuToolButton (GtkMenuToolButton *button, bool owns_reference=false)
    Construct a new MenuToolButton from an existing GtkMenuToolButton.

## Detailed Description

A GtkMenuToolButton C++ wrapper class.

MenuToolButton is a ToolItem that contains a button and a small additional button with an arrow. When clicked, the arrow button pops up a dropdown menu.

## Constructor & Destructor Documentation

Xfc::Gtk::MenuToolButton::MenuToolButton | ( | GtkMenuToolButton * | button,
|  | bool | owns_reference = `false`
| ) | `[explicit, protected]`

Construct a new MenuToolButton from an existing GtkMenuToolButton.

Parameters:

  | button | A pointer to a GtkMenuToolButton.
  | owns_reference | Set false if the initial reference count is floating, set true if it's not.

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

Xfc::Gtk::MenuToolButton::MenuToolButton | ( | Widget & | icon_widget | ) |

Constructs a new menu tool button using icon_widget as the icon.

Parameters:

  | icon_widget | A widget that will be used as the icon widget.

Xfc::Gtk::MenuToolButton::MenuToolButton | ( | const String & | label,
|  | bool | use_underline = `false`
| ) |

Constructs a new menu tool button using label as the label.

Parameters:

  | label | A string that will be used as the label.
  | use_underline | Whether the button label has the mnemonic form "_Open".

Xfc::Gtk::MenuToolButton::MenuToolButton | ( | Widget & | icon_widget,
|  | const String & | label,
|  | bool | use_underline = `false`
| ) |

Constructs a new menu tool button using label as the label.

Parameters:

  | icon_widget | A widget that will be used as the icon widget.
  | label | A string that will be used as the label.
  | use_underline | Whether the button label has the mnemonic form "_Open".

Xfc::Gtk::MenuToolButton::MenuToolButton | ( | const StockId & | stock_id | ) |

Constructs a new menu tool button containing the image and text from a stock item.

Parameters:

  | stock_id | The ID of the stock item (see set_stock_id()).

It is an error if stock_id is not a name of a stock item.

## Member Function Documentation

Menu* Xfc::Gtk::MenuToolButton::get_menu | ( |  | ) | const

Gets the Menu associated with the MenuToolButton.

Returns:
  The Menu associated with MenuToolButton.

void Xfc::Gtk::MenuToolButton::set_arrow_tooltip | ( | Tooltips & | tooltips,
|  | const String & | tip_text,
|  | const String & | tip_private
| ) |

Sets the Tooltips object to be used for the arrow button which pops up the menu.

Parameters:

  | tooltips | The Tooltips object to be used.
  | tip_text | The text to be used as tooltip text for tool_item.
  | tip_private | The text to be used as private tooltip text.

To set the tooltip on the whole MenuToolButton see Gtk:ToolItem::set_tooltip().

void Xfc::Gtk::MenuToolButton::set_menu | ( | Menu * | menu | ) |

Sets the Menu that is popped up when the user clicks on the arrow.

Parameters:

  | menu | The Gtk::Menu associated with MenuToolButton.

If menu is null, the arrow button becomes insensitive.

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

- menutoolbutton.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3