新規作成  編集  Ruby-GNOME2 Project Website  ページ一覧  検索  更新履歴  編集履歴  RSS  ログイン

Gtk::Stock

module Gtk::Stock

Stock items represent commonly-used menu or toolbar items such as "Open" or "Exit". Each stock item is identified by a stock ID. Applications can register their own stock items in addition to those built-in to GTK+.

Each stock ID can be associated with a stock item, which contains the user-visible label, keyboard accelerator, and translation domain of the menu or toolbar item; and/or with an icon stored in a Gtk::IconFactory. See Gtk::IconFactory for more information on stock icons. The connection between a stock item and stock icons is purely conventional (by virtue of using the same stock ID); it's possible to register a stock item but no icon, and vice versa.

Module Functions

Gtk::Stock.add(stock_id, label, modifier = 0, keyval = 0, translation_domain = nil)
Registers a stock item. If the item already exists with the same stock ID, the old item gets replaced.
  • stock_id: a stock id as Symbol value. e.g. :quit, :open, ...
  • label: a label text
  • modifier: a value of modifier keys(Gdk::Window#GdkModifierType).
  • keyval: a key value
  • translation_domain: TextDomain for i18n text(GetText)
Gtk::Stock.lookup(stock_id)
Retrieve the registered values for stock_id. Throw ArgumentError if stock_id was not found.
  • stock_id: a stock item name
  • Returns: [stock_id, label, modifier, keyval, translation_domain]
Gtk::Stock.ids
Retrieves a list of all known stock IDs added to a Gtk::IconFactory or registered with Gtk::Stock.add.
  • Returns: a list of known stock IDs
Gtk::Stock.set_translate_func(domain) { |path| ... }
Sets a block to be used for translating the label of a stock item. If no function is registered for a translation domain, dgettext() is used. Since 2.8
  • domain: the translation domain for which the block shall be used (String)
  • { |path| ...}: the block to be used for translation
    • path: the id of the message
  • Returns: nil

Constants

Gtk::Stock::ABOUT
The "About" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_about_24.png> Since 2.6
Gtk::Stock::ADD
The "Add" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_add_24.png>
Gtk::Stock::APPLY
The "Apply" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_apply_20.png>
Gtk::Stock::BOLD
The "Bold" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_text_bold_24.png>
Gtk::Stock::CANCEL
The "Cancel" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_cancel_20.png>
Gtk::Stock::CDROM
The "CD-Rom" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_cdrom_24.png>
Gtk::Stock::CLEAR
The "Clear" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_clear_24.png>
Gtk::Stock::CLOSE
The "Close" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_close_24.png>
Gtk::Stock::COLOR_PICKER
The "Color Picker" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_colorselector_24.png> Since 2.2
Gtk::Stock::CONVERT
The "Convert" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_convert_24.png>
Gtk::Stock::CONNECT
The "Connect" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_connect_24.png> Since 2.6
Gtk::Stock::COPY
The "Copy" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_copy_24.png>
Gtk::Stock::CUT
The "Cut" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_cut_24.png>
Gtk::Stock::DELETE
The "Delete" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_trash_24.png>
Gtk::Stock::DIALOG_AUTHENTICATION
The "Authentication" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_dialog_authentication_48.png> Since 2.4
Gtk::Stock::DIALOG_ERROR
The "Error" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_dialog_error_48.png>
Gtk::Stock::DIALOG_INFO
The "Information" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_dialog_info_48.png>
Gtk::Stock::DIALOG_QUESTION
The "Question" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_dialog_question_48.png>
Gtk::Stock::DIALOG_WARNING
The "Warning" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_dialog_warning_48.png>
Gtk::Stock::DISCONNECT
The "Disconnect" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_disconnect_24.png> Since 2.6
Gtk::Stock::DND
The "Drag-And-Drop" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_dnd_32.png>
Gtk::Stock::DND_MULTIPLE
The "Drag-And-Drop multiple" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_dnd_multiple_32.png>
Gtk::Stock::EDIT
The "Edit" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_edit_24.png> Since 2.6
Gtk::Stock::EXECUTE
The "Execute" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_exec_24.png>
Gtk::Stock::FILE
The "File" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_file_24.png> Since 2.6
Gtk::Stock::FIND
The "Find" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_search_24.png>
Gtk::Stock::FIND_AND_REPLACE
The "Find and Replace" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_search_replace_24.png>
Gtk::Stock::FLOPPY
The "Floppy" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_save_24.png>
Gtk::Stock::FULLSCREEN
The "Fullscreen" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_fullscreen_24.png> Since 2.8
Gtk::Stock::GOTO_BOTTOM
The "Bottom" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_bottom_24.png>
Gtk::Stock::GOTO_FIRST
The "First" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_first_24.png>
Gtk::Stock::GOTO_LAST
The "Last" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_last_24.png>
Gtk::Stock::GOTO_TOP
The "Top" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_top_24.png>
Gtk::Stock::GO_BACK
The "Back" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_left_arrow_24.png>
Gtk::Stock::GO_DOWN
The "Down" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_down_arrow_24.png>
Gtk::Stock::GO_FORWARD
The "Forward" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_right_arrow_24.png>
Gtk::Stock::GO_UP
The "Up" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_up_arrow_24.png>
Gtk::Stock::HARDDISK
The "Hard disk" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_harddisk_24.png> Since 2.4
Gtk::Stock::HELP
The "Help" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_help_24.png>
Gtk::Stock::HOME
The "Home" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_home_24.png>
Gtk::Stock::INDENT
The "Indent" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_text_indent_24.png> Since 2.4
Gtk::Stock::INDEX
The "Index" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_index_24.png>
Gtk::Stock::INFO
The "Info" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_info_24.png> Since 2.8
Gtk::Stock::ITALIC
The "Italic" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_text_italic_24.png>
Gtk::Stock::JUMP_TO
The "Jump to" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_jump_to_24.png>
Gtk::Stock::JUSTIFY_CENTER
The "Center" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_align_center_24.png>
Gtk::Stock::JUSTIFY_FILL
The "Fill" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_align_justify_24.png>
Gtk::Stock::JUSTIFY_LEFT
The "Left" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_align_left_24.png>
Gtk::Stock::JUSTIFY_RIGHT
The "Right" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_align_right_24.png>
Gtk::Stock::LEAVE_FULLSCREEN
The "Leave fullscreent" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_leave_fullscreen_24.png> Since 2.8
Gtk::Stock::MEDIA_FORWARD
The "Media forward" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_media_forward_24.png> Since 2.6
Gtk::Stock::MEDIA_NEXT
The "Media next" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_media_next_24.png> Since 2.6
Gtk::Stock::MEDIA_PAUSE
The "Media pause" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_media_pause_24.png> Since 2.6
Gtk::Stock::MEDIA_PLAY
The "Media play" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_media_play_24.png> Since 2.6
Gtk::Stock::MEDIA_PREVIOUS
The "Media previous" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_media_previous_24.png> Since 2.6
Gtk::Stock::MEDIA_RECORD
The "Media record" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_media_record_24.png> Since 2.6
Gtk::Stock::MEDIA_REWIND
The "Media rewind" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_media_rewind_24.png> Since 2.6
Gtk::Stock::MEDIA_STOP
The "Media stop" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_media_stop_24.png> Since 2.6
Gtk::Stock::MISSING_IMAGE
The "Missing image" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_broken_image_24.png>
Gtk::Stock::NETWORK
The "Network" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_network_24.png> Since 2.4
Gtk::Stock::NEW
The "New" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_new_24.png>
Gtk::Stock::NO
The "No" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_no_20.png>
Gtk::Stock::OK
The "OK" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_ok_20.png>
Gtk::Stock::OPEN
The "Open" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_open_24.png>
Gtk::Stock::PASTE
The "Paste" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_paste_24.png>
Gtk::Stock::PREFERENCES
The "Preferences" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_preferences_24.png>
Gtk::Stock::PRINT
The "Print" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_print_24.png>
Gtk::Stock::PRINT_PREVIEW
The "Print Preview" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_print_preview_24.png>
Gtk::Stock::PROPERTIES
The "Properties" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_properties_24.png>
Gtk::Stock::QUIT
The "Quit" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_exit_24.png>
Gtk::Stock::REDO
The "Redo" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_redo_24.png>
Gtk::Stock::REFRESH
The "Refresh" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_refresh_24.png>
Gtk::Stock::REMOVE
The "Remove" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_remove_24.png>
Gtk::Stock::REVERT_TO_SAVED
The "Revert" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_revert_24.png>
Gtk::Stock::SAVE
The "Save" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_save_24.png>
Gtk::Stock::SAVE_AS
The "Save As" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_save_as_24.png>
Gtk::Stock::SELECT_COLOR
The "Color" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_colorselector_24.png>
Gtk::Stock::SELECT_FONT
The "Font" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_font_24.png>
Gtk::Stock::SORT_ASCENDING
The "Ascending" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_sort_ascending_24.png>
Gtk::Stock::SORT_DESCENDING
The "Descending" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_sort_descending_24.png>
Gtk::Stock::SPELL_CHECK
The "Spell Check" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_spellcheck_24.png>
Gtk::Stock::STOP
The "Stop" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_stop_24.png>
Gtk::Stock::STRIKETHROUGH
The "Strikethrough" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_text_strikethrough_24.png>
Gtk::Stock::UNDELETE
The "Undelete" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_undelete_24.png>
Gtk::Stock::UNDERLINE
The "Underline" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_text_underline_24.png>
Gtk::Stock::UNDO
The "Undo" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_undo_24.png>
Gtk::Stock::UNINDENT
The "Unindent" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_text_unindent_24.png> Since 2.4
Gtk::Stock::YES
The "Yes" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_yes_20.png>
Gtk::Stock::ZOOM_100
The "Zoom 100%" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_zoom_1_24.png>
Gtk::Stock::ZOOM_FIT
The "Zoom to Fit" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_zoom_fit_24.png>
Gtk::Stock::ZOOM_IN
The "Zoom In" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_zoom_in_24.png>
Gtk::Stock::ZOOM_OUT
The "Zoom Out" item. <URL:http://developer.gnome.org/doc/API/2.0/gtk/stock_zoom_out_24.png>