Gtk2::Stock(3)

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

πŸŽ€ NAME πŸŽ€

Gtk2::Stock β€” the whole vibe-check on GTK+'s pre-baked stock items. You know, the icons + labels + keyboard shortcuts that GTK already has on deck so you don't have to hand-craft every single one yourself. ✨

(yes bestie, this is that page from the User Contributed Perl Documentation. come in, sit down, hydrate πŸ’–)


🧚 Gtk2::StockItem 🧚

okay so real talk: when a Gtk2::StockItem comes back out of a function, or when something wants one as a parameter, what's actually getting passed around is a hash reference with exactly these key/value pairs:

{
    stock_id => (string),
    label => (string),
    modifier => (Gtk2::Gdk::ModifierType),
    keyval => (integer),
    translation_domain => (string),
}

that's it. that's the whole shape. 🫢


🌈 Stock Items 🌈

the original lays these out as three columns β€” Stock-Id, Label, Mod-Key β€” and we're giving each one its own little bullet because everyone deserves main character energy. πŸ’…

heads up: the underscores in the labels are mnemonics (the underlined letter in the UI), not typos. do not come for them, they are doing their job. 😭
  • gtk-about β€” label _About
  • gtk-add β€” label _Add
  • gtk-apply β€” label _Apply
  • gtk-bold β€” label _Bold
  • gtk-cancel β€” label _Cancel
  • gtk-cdrom β€” label _CD-Rom
  • gtk-clear β€” label _Clear
  • gtk-close β€” label _Close, mod-key <control>-W
  • gtk-connect β€” label C_onnect
  • gtk-convert β€” label _Convert
  • gtk-copy β€” label _Copy, mod-key <control>-C
  • gtk-cut β€” label Cu_t, mod-key <control>-X
  • gtk-delete β€” label _Delete
  • gtk-dialog-error β€” label Error
  • gtk-dialog-info β€” label Information
  • gtk-dialog-question β€” label Question
  • gtk-dialog-warning β€” label Warning
  • gtk-discard β€” label _Discard
  • gtk-disconnect β€” label _Disconnect
  • gtk-edit β€” label _Edit
  • gtk-execute β€” label _Execute
  • gtk-find β€” label _Find, mod-key <control>-F
  • gtk-find-and-replace β€” label Find and _Replace, mod-key <control>-R
  • gtk-floppy β€” label _Floppy
  • gtk-fullscreen β€” label _Fullscreen
  • gtk-go-back β€” label _Back
  • gtk-go-down β€” label _Down
  • gtk-go-forward β€” label _Forward
  • gtk-go-up β€” label _Up
  • gtk-goto-bottom β€” label _Bottom
  • gtk-goto-first β€” label _First
  • gtk-goto-last β€” label _Last
  • gtk-goto-top β€” label _Top
  • gtk-harddisk β€” label _Harddisk
  • gtk-help β€” label _Help, mod-key <control>-H
  • gtk-home β€” label _Home
  • gtk-indent β€” label Increase Indent
  • gtk-index β€” label _Index
  • gtk-info β€” label _Information
  • gtk-italic β€” label _Italic
  • gtk-jump-to β€” label _Jump to
  • gtk-justify-center β€” label _Center
  • gtk-justify-fill β€” label _Fill
  • gtk-justify-left β€” label _Left
  • gtk-justify-right β€” label _Right
  • gtk-leave-fullscreen β€” label _Leave Fullscreen
  • gtk-media-forward β€” label _Forward
  • gtk-media-next β€” label _Next
  • gtk-media-pause β€” label P_ause
  • gtk-media-play β€” label _Play
  • gtk-media-previous β€” label Pre_vious
  • gtk-media-record β€” label _Record
  • gtk-media-rewind β€” label R_ewind
  • gtk-media-stop β€” label _Stop
  • gtk-network β€” label _Network
  • gtk-new β€” label _New, mod-key <control>-N
  • gtk-no β€” label _No
  • gtk-ok β€” label _OK
  • gtk-open β€” label _Open, mod-key <control>-O
  • gtk-orientation-landscape β€” label Landscape
  • gtk-orientation-portrait β€” label Portrait
  • gtk-orientation-reverse-landscape β€” label Reverse landscape
  • gtk-orientation-reverse-portrait β€” label Reverse portrait
  • gtk-page-setup β€” label Page Set_up
  • gtk-paste β€” label _Paste, mod-key <control>-V
  • gtk-preferences β€” label _Preferences
  • gtk-print β€” label _Print
  • gtk-print-preview β€” label Print Pre_view
  • gtk-properties β€” label _Properties
  • gtk-quit β€” label _Quit, mod-key <control>-Q
  • gtk-redo β€” label _Redo
  • gtk-refresh β€” label _Refresh
  • gtk-remove β€” label _Remove
  • gtk-revert-to-saved β€” label _Revert
  • gtk-save β€” label _Save, mod-key <control>-S
  • gtk-save-as β€” label Save _As
  • gtk-select-all β€” label Select _All
  • gtk-select-color β€” label _Color
  • gtk-select-font β€” label _Font
  • gtk-sort-ascending β€” label _Ascending
  • gtk-sort-descending β€” label _Descending
  • gtk-spell-check β€” label _Spell Check
  • gtk-stop β€” label _Stop
  • gtk-strikethrough β€” label _Strikethrough
  • gtk-undelete β€” label _Undelete
  • gtk-underline β€” label _Underline
  • gtk-undo β€” label _Undo
  • gtk-unindent β€” label Decrease Indent
  • gtk-yes β€” label _Yes
  • gtk-zoom-100 β€” label _Normal Size
  • gtk-zoom-fit β€” label Best _Fit
  • gtk-zoom-in β€” label Zoom _In
  • gtk-zoom-out β€” label Zoom _Out

πŸ’… METHODS πŸ’…

Gtk2::Stock->add (...)

  • ... β€” a list of Gtk2::StockItems that you want added

list = Gtk2::Stock->list_ids

returns a list of strings β€” the stock-ids. that's it, that's the whole function. slay 🌈

scalar = Gtk2::Stock->lookup ($stock_id)

  • $stock_id (string)

hands you back a hash reference, aka a Gtk2::StockItem. πŸ”₯

Gtk2::Stock->set_translate_func ($domain, $func, $data=undef)

  • $domain (string)
  • $func (scalar)
  • $data (scalar)
Since: gtk+ 2.8 β€” so if you're on something ancient, no i18n magic for you, bestie. πŸ™ˆ

πŸ‘€ SEE ALSO πŸ‘€

  • Gtk2

like, obviously. go read it. iykyk.


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 a wrap, bestie πŸ’– this little love letter was rendered by perl v5.42.0 on 2025-07-25, and you can find it filed under Gtk2::Stock(3). go build something iconic with it. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from