Gtk2::ToolPalette(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– Gtk2::ToolPalette β€” bestie edition πŸ’–

okay so. this is the Perl wrapper for GtkToolPalette, from the Gtk2 docs (user contributed perl documentation, iykyk). it's giving "a little grid of tool groups you can drag stuff out of" and honestly? iconic. let's get into it. πŸŽ€


✨ NAME ✨

Gtk2::ToolPalette β€” the wrapper for GtkToolPalette. that's it, that's the name, she's straightforward and we love that for her. πŸ’…


🌸 HIERARCHY 🌸

so she's got a whole family tree, and you gotta know your lineage:

  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::Widget
                 +----Gtk2::Container
                      +----Gtk2::ToolPalette

everyone up the chain is her ancestor, so all their methods are hers too. main character energy, fr. πŸ‘‘


πŸ¦‹ INTERFACES πŸ¦‹

she also implements these, so she can do their tricks:

  • Glib::Object::_Unregistered::AtkImplementorIface
  • Gtk2::Buildable
  • Gtk2::Orientable

⭐ METHODS ⭐

widget = Gtk2::ToolPalette->new

constructor, bestie. makes you a brand new palette. no args, no drama. ✨


$palette->add_drag_dest ($widget, $flags, $targets, $actions)

sets up a drag destination on this palette. the args, in order:

  • $widget (Gtk2::Widget)
  • $flags (Gtk2::DestDefaults)
  • $targets (Gtk2::ToolPaletteDragTargets)
  • $actions (Gtk2::Gdk::DragAction)

widget = $palette->get_drag_item ($selection)

gives you back the widget that got dragged. takes:

  • $selection (Gtk2::SelectionData)

$palette->set_drag_source ($targets)

tells the palette what can be dragged out of it. takes:

  • $targets (Gtk2::ToolPaletteDragTargets)

targetentry = Gtk2::ToolPalette->get_drag_target_group

class method, no args. hands you a targetentry. that's literally all the original says and i will not be inventing lore. πŸ™ˆ


targetentry = Gtk2::ToolPalette->get_drag_target_item

same vibe, class method, no args, returns a targetentry. twin of the one above. πŸ’–


toolitemgroup or undef = $palette->get_drop_group ($x, $y)

which group is under these coords? may return undef if there's nothing there, so like… check before you use it bestie.

  • $x (integer)
  • $y (integer)

toolitem or undef = $palette->get_drop_item ($x, $y)

which item is under these coords? also possibly undef, also possibly not. no cap.

  • $x (integer)
  • $y (integer)

boolean = $palette->get_exclusive ($group)

is this group the special one? returns a boolean.

  • $group (Gtk2::ToolItemGroup)

$palette->set_exclusive ($group, $exclusive)

makes a group exclusive (or un-exclusive).

  • $group (Gtk2::ToolItemGroup)
  • $exclusive (boolean)

boolean = $palette->get_expand ($group)

does this group get the extra space when the palette grows? boolean says yes/no.

  • $group (Gtk2::ToolItemGroup)

$palette->set_expand ($group, $expand)

set whether that group expands.

  • $group (Gtk2::ToolItemGroup)
  • $expand (boolean)

integer = $palette->get_group_position ($group)

where does this group sit in the order? integer, bestie.

  • $group (Gtk2::ToolItemGroup)

$palette->set_group_position ($group, $position)

move the group to a position.

  • $group (Gtk2::ToolItemGroup)
  • $position (integer)

adjustment = $palette->get_hadjustment

horizontal adjustment. that's the whole method. she's short and she knows it. πŸ’…


iconsize = $palette->get_icon_size

gets the icon size. no args, just vibes and a return value. 🌈


$palette->set_icon_size ($icon_size)

sets the icon size. takes:

  • $icon_size (Gtk2::IconSize)

toolbarstyle = $palette->get_style

gets the toolbar style. yes, she has a style. obviously. πŸ‘‘


$palette->set_style ($style)

sets the toolbar style. takes:

  • $style (Gtk2::ToolbarStyle)

$palette->unset_icon_size

un-sets the icon size. that's it. no args. very "not me undoing my own choices" energy. 😭


$palette->unset_style

un-sets the style. also no args. also very that. πŸ™ˆ


adjustment = $palette->get_vadjustment

vertical adjustment. the sequel to get_hadjustment. πŸŽ€


πŸ’œ PROPERTIES πŸ’œ

  • 'icon-size' (Gtk2::IconSize : default "small-toolbar" : readable / writable / private / static-nick / static-blurb) β€” Size of icons in this tool palette
  • 'icon-size-set' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” Whether the icon-size property has been set
  • 'toolbar-style' (Gtk2::ToolbarStyle : default "icons" : readable / writable / private / static-nick / static-blurb) β€” Style of items in the tool palette

πŸŽ€ CHILD PROPERTIES πŸŽ€

these belong to the child (the group), not to the palette herself. slay.

  • 'exclusive' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” Whether the item group should be the only expanded at a given time
  • 'expand' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” Whether the item group should receive extra space when the palette grows

🌟 SIGNALS 🌟

  • set-scroll-adjustments (Gtk2::ToolPalette, Gtk2::Adjustment, Gtk2::Adjustment)

🧚 ENUMS AND FLAGS 🧚

flags Gtk2::DestDefaults

  • 'motion' / GTK_DEST_DEFAULT_MOTION
  • 'highlight' / GTK_DEST_DEFAULT_HIGHLIGHT
  • 'drop' / GTK_DEST_DEFAULT_DROP
  • 'all' / GTK_DEST_DEFAULT_ALL

flags Gtk2::Gdk::DragAction

  • 'default' / GDK_ACTION_DEFAULT
  • 'copy' / GDK_ACTION_COPY
  • 'move' / GDK_ACTION_MOVE
  • 'link' / GDK_ACTION_LINK
  • 'private' / GDK_ACTION_PRIVATE
  • 'ask' / GDK_ACTION_ASK

enum Gtk2::IconSize

  • 'invalid' / GTK_ICON_SIZE_INVALID
  • 'menu' / GTK_ICON_SIZE_MENU
  • 'small-toolbar' / GTK_ICON_SIZE_SMALL_TOOLBAR
  • 'large-toolbar' / GTK_ICON_SIZE_LARGE_TOOLBAR
  • 'button' / GTK_ICON_SIZE_BUTTON
  • 'dnd' / GTK_ICON_SIZE_DND
  • 'dialog' / GTK_ICON_SIZE_DIALOG

flags Gtk2::ToolPaletteDragTargets

  • 'items' / GTK_TOOL_PALETTE_DRAG_ITEMS
  • 'groups' / GTK_TOOL_PALETTE_DRAG_GROUPS

enum Gtk2::ToolbarStyle

  • 'icons' / GTK_TOOLBAR_ICONS
  • 'text' / GTK_TOOLBAR_TEXT
  • 'both' / GTK_TOOLBAR_BOTH
  • 'both-horiz' / GTK_TOOLBAR_BOTH_HORIZ

πŸ”₯ SEE ALSO πŸ”₯

go read these too, bestie, they're her friends:

Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container


Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


and that's the whole page, periodt. 🫢 this was Gtk2::ToolPalette(3), from perl v5.42.0, dated 2025-07-25 β€” love u, go build something cute with a palette in it, mwah πŸ’–βœ¨πŸ“

πŸ“¦ where this page comes from