gtkmm: Gtk::ToolPalette Class Reference

gtkmm 3.1.90

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Related Functions

# Gtk::ToolPalette Class Reference
Widgets | Container Widgets

A ToolPalette allows you to add ToolItems to a palette-like container with various categories and drag and drop support. More...

Inheritance diagram for Gtk::ToolPalette:
[legend]
Collaboration diagram for Gtk::ToolPalette:
[legend]

List of all members.

## Public Member Functions
virtual | ~ToolPalette ()
GtkToolPalette* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkToolPalette* | gobj () const
| Provides access to the underlying C GtkObject.
| ToolPalette ()
void | set_group_position (ToolItemGroup& group, int position)
| Sets the position of the group as an index of the tool palette.
void | set_exclusive (ToolItemGroup& group, bool exclusive)
| Sets whether the group should be exclusive or not.
void | set_expand (ToolItemGroup& group, bool expand=true)
| Sets whether the group should be given extra space.
int | get_group_position (ToolItemGroup& group) const
| Gets the position of group in palette as index.
bool | get_exclusive (ToolItemGroup& group) const
| Gets whether group is exclusive or not.
bool | get_expand (ToolItemGroup& group) const
| Gets whether group should be given extra space.
void | set_icon_size (IconSize icon_size)
| Sets the size of icons in the tool palette.
void | unset_icon_size ()
| Unsets the tool palette icon size set with set_icon_size(), so that user preferences will be used to determine the icon size.
void | set_style (ToolbarStyle style)
| Sets the style (text, icons or both) of items in the tool palette.
void | unset_style ()
| Unsets a toolbar style set with set_style(), so that user preferences will be used to determine the toolbar style.
IconSize | get_icon_size () const
| Gets the size of icons in the tool palette.
ToolbarStyle | get_style () const
| Gets the style (icons, text or both) of items in the tool palette.
ToolItem* | get_drop_item (int x, int y)
| Gets the item at position (x, y).
const ToolItem* | get_drop_item (int x, int y) const
| Gets the item at position (x, y).
ToolItemGroup* | get_drop_group (int x, int y)
| Gets the group at position (x, y).
const ToolItemGroup* | get_drop_group (int x, int y) const
| Gets the group at position (x, y).
ToolItem* | get_drag_item (const SelectionData& selection)
| Get the dragged item from the selection.
const ToolItem* | get_drag_item (const SelectionData& selection) const
| Get the dragged item from the selection.
void | set_drag_source (ToolPaletteDragTargets targets=TOOL_PALETTE_DRAG_ITEMS)
| Sets the tool palette as a drag source.
void | add_drag_dest (Gtk::Widget& widget, DestDefaults flags=DEST_DEFAULT_ALL, ToolPaletteDragTargets targets=TOOL_PALETTE_DRAG_ITEMS, Gdk::DragAction actions=Gdk::ACTION_COPY)
| Sets palette as drag source (see set_drag_source()) and sets widget as a drag destination for drags from palette.
Glib::PropertyProxy< IconSize > | property_icon_size ()
| Size of icons in this tool palette.
Glib::PropertyProxy_ReadOnly < IconSize > | property_icon_size () const
| Size of icons in this tool palette.
Glib::PropertyProxy< bool > | property_icon_size_set ()
| Whether the icon-size property has been set.
Glib::PropertyProxy_ReadOnly < bool > | property_icon_size_set () const
| Whether the icon-size property has been set.
Glib::PropertyProxy< ToolbarStyle > | property_toolbar_style ()
| Style of items in the tool palette.
Glib::PropertyProxy_ReadOnly < ToolbarStyle > | property_toolbar_style () const
| Style of items in the tool palette.
## Static Public Member Functions
static TargetEntry | get_drag_target_item ()
| Gets the target entry for a dragged Gtk::ToolItem.
static TargetEntry | get_drag_target_group ()
| Get the target entry for a dragged Gtk::ToolItemGroup.
## Related Functions
(Note that these are not member functions.)
Gtk::ToolPalette* | wrap (GtkToolPalette* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

A ToolPalette allows you to add ToolItems to a palette-like container with various categories and drag and drop support.

ToolItems cannot be added directly to a ToolPalette - instead they are added to a ToolItemGroup which can than be added to a ToolPalette. To add a ToolItemGroup to a ToolPalette, use Gtk::Container::add().

The easiest way to use drag and drop with ToolPalette is to call add_drag_dest() with the desired drag source palette and the desired drag target widget. Then get_drag_item() can be used to get the dragged item in the "drag-data-received" signal handler of the drag target.

Since gtkmm 2.20:

## Constructor & Destructor Documentation

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

Gtk::ToolPalette::ToolPalette | ( |  | ) |

## Member Function Documentation

void Gtk::ToolPalette::add_drag_dest | ( | Gtk::Widget& | widget,
|  | DestDefaults | flags = `DEST_DEFAULT_ALL`,
|  | ToolPaletteDragTargets | targets = `TOOL_PALETTE_DRAG_ITEMS`,
|  | Gdk::DragAction | actions = `Gdk::ACTION_COPY`
| ) |  |

Sets palette as drag source (see set_drag_source()) and sets widget as a drag destination for drags from palette.

See gtk_drag_dest_set().

Since gtkmm 2.20:

Parameters:

  widget | A Gtk::Widget which should be a drag destination for palette.
  flags | The flags that specify what actions GTK+ should take for drops on that widget.
  targets | The Gtk::ToolPaletteDragTargets which the widget should support.
  actions | The Gdk::DragActions which the widget should suppport.

ToolItem* Gtk::ToolPalette::get_drag_item | ( | const SelectionData& | selection | ) |

Get the dragged item from the selection.

This could be a Gtk::ToolItem or a Gtk::ToolItemGroup.

Since gtkmm 2.20:

Parameters:

  selection | A Gtk::SelectionData.

Returns:
  The dragged item in selection.

const ToolItem* Gtk::ToolPalette::get_drag_item | ( | const SelectionData& | selection | ) | const

Get the dragged item from the selection.

This could be a Gtk::ToolItem or a Gtk::ToolItemGroup.

Since gtkmm 2.20:

Parameters:

  selection | A Gtk::SelectionData.

Returns:
  The dragged item in selection.

static TargetEntry Gtk::ToolPalette::get_drag_target_group | ( |  | ) | `[static]`

Get the target entry for a dragged Gtk::ToolItemGroup.

Since gtkmm 2.20:

Returns:
  The Gtk::TargetEntry for a dragged group.

static TargetEntry Gtk::ToolPalette::get_drag_target_item | ( |  | ) | `[static]`

Gets the target entry for a dragged Gtk::ToolItem.

Since gtkmm 2.20:

Returns:
  The Gtk::TargetEntry for a dragged item.

const ToolItemGroup* Gtk::ToolPalette::get_drop_group | ( | int | x,
|  | int | y
| ) |  | const

Gets the group at position (x, y).

Since gtkmm 2.20:

Parameters:

  x | The x position.
  y | The y position.

Returns:
  The Gtk::ToolItemGroup at position or `0` if there is no such group.

ToolItemGroup* Gtk::ToolPalette::get_drop_group | ( | int | x,
|  | int | y
| ) |  |

Gets the group at position (x, y).

Since gtkmm 2.20:

Parameters:

  x | The x position.
  y | The y position.

Returns:
  The Gtk::ToolItemGroup at position or `0` if there is no such group.

ToolItem* Gtk::ToolPalette::get_drop_item | ( | int | x,
|  | int | y
| ) |  |

Gets the item at position (x, y).

See get_drop_group().

Since gtkmm 2.20:

Parameters:

  x | The x position.
  y | The y position.

Returns:
  The Gtk::ToolItem at position or `0` if there is no such item.

const ToolItem* Gtk::ToolPalette::get_drop_item | ( | int | x,
|  | int | y
| ) |  | const

Gets the item at position (x, y).

See get_drop_group().

Since gtkmm 2.20:

Parameters:

  x | The x position.
  y | The y position.

Returns:
  The Gtk::ToolItem at position or `0` if there is no such item.

bool Gtk::ToolPalette::get_exclusive | ( | ToolItemGroup& | group | ) | const

Gets whether group is exclusive or not.

See set_exclusive().

Since gtkmm 2.20:

Parameters:

  group | A Gtk::ToolItemGroup which is a child of palette.

Returns:
  `true` if group is exclusive.

bool Gtk::ToolPalette::get_expand | ( | ToolItemGroup& | group | ) | const

Gets whether group should be given extra space.

See set_expand().

Since gtkmm 2.20:

Parameters:

  group | A Gtk::ToolItemGroup which is a child of palette.

Returns:
  `true` if group should be given extra space, `false` otherwise.

int Gtk::ToolPalette::get_group_position | ( | ToolItemGroup& | group | ) | const

Gets the position of group in palette as index.

See set_group_position().

Since gtkmm 2.20:

Parameters:

  group | A Gtk::ToolItemGroup.

Returns:
  The index of group or -1 if group is not a child of palette.

IconSize Gtk::ToolPalette::get_icon_size | ( |  | ) | const

Gets the size of icons in the tool palette.

See set_icon_size().

Since gtkmm 2.20:

Returns:
  The Gtk::IconSize of icons in the tool palette.

ToolbarStyle Gtk::ToolPalette::get_style | ( |  | ) | const

Gets the style (icons, text or both) of items in the tool palette.

Since gtkmm 2.20:

Returns:
  The Gtk::ToolbarStyle of items in the tool palette.

const GtkToolPalette* Gtk::ToolPalette::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

GtkToolPalette* Gtk::ToolPalette::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

Glib::PropertyProxy<IconSize> Gtk::ToolPalette::property_icon_size | ( |  | ) |

Size of icons in this tool palette.

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<IconSize> Gtk::ToolPalette::property_icon_size | ( |  | ) | const

Size of icons in this tool palette.

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::ToolPalette::property_icon_size_set | ( |  | ) | const

Whether the icon-size property has been set.

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::ToolPalette::property_icon_size_set | ( |  | ) |

Whether the icon-size property has been set.

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::ToolPalette::property_toolbar_style | ( |  | ) |

Style of items in the tool palette.

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::ToolPalette::property_toolbar_style | ( |  | ) | const

Style of items in the tool palette.

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::ToolPalette::set_drag_source | ( | ToolPaletteDragTargets | targets = `TOOL_PALETTE_DRAG_ITEMS` | ) |

Sets the tool palette as a drag source.

Enables all groups and items in the tool palette as drag sources on button 1 and button 3 press with copy and move actions. See Gtk::DragSource::set().

Since gtkmm 2.20:

Parameters:

  targets | The Gtk::ToolPaletteDragTargets which the widget should support.

void Gtk::ToolPalette::set_exclusive | ( | ToolItemGroup& | group,
|  | bool | exclusive
| ) |  |

Sets whether the group should be exclusive or not.

If an exclusive group is expanded all other groups are collapsed.

Since gtkmm 2.20:

Parameters:

  group | A Gtk::ToolItemGroup which is a child of palette.
  exclusive | Whether the group should be exclusive or not.

void Gtk::ToolPalette::set_expand | ( | ToolItemGroup& | group,
|  | bool | expand = `true`
| ) |  |

Sets whether the group should be given extra space.

Since gtkmm 2.20:

Parameters:

  group | A Gtk::ToolItemGroup which is a child of palette.
  expand | Whether the group should be given extra space.

void Gtk::ToolPalette::set_group_position | ( | ToolItemGroup& | group,
|  | int | position
| ) |  |

Sets the position of the group as an index of the tool palette.

If position is 0 the group will become the first child, if position is -1 it will become the last child.

Since gtkmm 2.20:

Parameters:

  group | A Gtk::ToolItemGroup which is a child of palette.
  position | A new index for group.

void Gtk::ToolPalette::set_icon_size | ( | IconSize | icon_size | ) |

Sets the size of icons in the tool palette.

Since gtkmm 2.20:

Parameters:

  icon_size | The Gtk::IconSize that icons in the tool palette shall have.

void Gtk::ToolPalette::set_style | ( | ToolbarStyle | style | ) |

Sets the style (text, icons or both) of items in the tool palette.

Since gtkmm 2.20:

Parameters:

  style | The Gtk::ToolbarStyle that items in the tool palette shall have.

void Gtk::ToolPalette::unset_icon_size | ( |  | ) |

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

Since gtkmm 2.20:

void Gtk::ToolPalette::unset_style | ( |  | ) |

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

Since gtkmm 2.20:

## Friends And Related Function Documentation

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

A Glib::wrap() method for this object.

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:

- gtkmm/toolpalette.h