WIP: Modern Gtk3 - part 2
This is about migrating away from stock items which have been deprecated in Gtk 3.10.
Stock items just make it way easy to provide common UI elements that are found on many UIs: new, quit, cut, copy, paste, about, etc.
A stock item bundles:
- a translatable, underscorized label text.
- an icon name.
- a keyboard accelerator (this one does not change with language).
For example, with stock id GTK_STOCK_QUIT you get:
- "_Quit" label text
- "application-exit" icon name
- "Ctrl+Q" keyboard accelerator
Tanslations for stock label texts are provided by Gtk.
So stock items make it easy and direct to build menu items, toolbar buttons and even simple buttons, labels or images, because they bundle all that's needed. The underscore in label text is for keyboard navigation in menus.
Some references:
- announcement of deprecation on the gtk-devel mailing list: https://mail.gnome.org/archives/gtk-devel-list/2013-July/msg00000.html, http://gtk.10911.n7.nabble.com/Stock-Items-Deprecation-td81617.html.
- migration doc: https://docs.google.com/document/d/1KCVPoYQBqMbDP11tHPpjW6uaEHrvLUmcDPqKAppCY8o/pub
- migration table: https://docs.google.com/spreadsheets/d/1HavJQRPpMuq-N0GoN1wJR-9KEGXpKy3-NEPpZZkUGJY/pub?output=html (this one is partial, see below)