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

Gtk::MenuItem

Gtk::MenuItem クラス

The Gtk::MenuItem widget and the derived widgets are the only valid childs for menus. Their function is to correctly handle highlighting, alignment, events and submenus.

As it derives from Gtk::Bin it can hold any valid child widget, altough only a few are really useful.

インクルードされているモジュール

  • Gtk::Buildable?
  • Atk::Implementor
  • GLib::Interface?

クラスメソッド

Gtk::MenuItem.new(label = nil, use_underline = true)
Creates a new Gtk::MenuItem.
  • label: the text label to display next to the radio button.
  • use_underline: true if the label will be created underscores in label indicate the mnemonic for radio button.
  • Returns: a new Gtk::MenuItem.

インスタンスメソッド

right_justified?
Gets whether the menu item appears justified at the right side of the menu bar.
  • Returns : true if the menu item will appear at the far right if added to a menu bar.
right_justified=(right_justified)
Sets whether the menu item appears justified at the right side of a menu bar. This was traditionally done for "Help" menu items, but is now considered a bad idea. (If the widget layout is reversed for a right-to-left language like Hebrew or Arabic, right-justified-menu-items appear at the left.)
  • right_justified: if true the menu item will appear at the far right if added to a menu bar.
  • Returns: right_justified
set_right_justified(right_justified)
Same as Gtk::MenuItem#right_justified=.
  • right_justified: if true the menu item will appear at the far right if added to a menu bar.
  • Returns: self
submenu
Gets the submenu underneath this menu item, if any. See Gtk::MenuItem#submenu=.
  • Returns: submenu for this menu item, or nil if none.
submenu=(submenu)
Sets the widget submenu, or changes it.
  • submenu : the submenu(a widget which is a subclass of Gtk::Widget)
  • Returns: submenu
set_submenu(submenu)
Same as Gtk::MenuItem#submenu=.
  • submenu: the submenu(a widget which is a subclass of Gtk::Widget)
  • Returns: submenu
remove_submenu
Removes the widget's submenu.
  • Returns: self
accel_path=(accel_path)
Set the accelerator path on menu_item, through which runtime changes of the menu item's accelerator caused by the user can be identified and saved to persistant storage (see Gtk::AccelMap#save on this). To setup a default accelerator for this menu item, call Gtk::AccelMap#add_entry with the same accel_path. See also Gtk::AccelMap#add_entry on the specifics of accelerator paths, and Gtk::Menu#accel_path= for a more convenient variant of this function. This method is basically a convenience wrapper that handles calling Gtk::Widget#accel_path= with the appropriate accelerator group for the menu item. Note that you do need to set an accelerator on the parent menu with Gtk::Menu#accel_group= for this to work.
  • accel_path: accelerator path, corresponding to this menu item's functionality, or nil to unset the current path.
  • Returns: accel_path
set_accel_path(accel_path)
Same as Gtk::MenuItem#accel_path=.
  • accel_path: accelerator path, corresponding to this menu item's functionality, or nil to unset the current path.
  • Returns: self
select

上位クラス(ancestors)のページに要移動?

Emits the "select" signal on the given item. Behaves exactly like Gtk::Item#select.

  • Returns: self
deselect

上位クラス(ancestors)のページに要移動?

Emits the "deselect" signal on the given item. Behaves exactly like Gtk::Item#deselect.

  • Returns: self
activate
Emits the "activate" signal on the given item.
  • Returns: self
toggle_size_request
Emits the "toggle_size_request" signal on the given item.
  • Returns: the requisition to use as signal data.
toggle_size_allocate(allocation)
Emits the "toggle_size_allocate" signal on the given item.
  • allocation: the allocation to use as signal data.
  • Returns: self
use_underline=()
要編集
set_use_underline()
要編集
use_underline?()
要編集
label=()
要編集
set_label()
要編集
label()
要編集
accel_path()
要編集

プロパティ

use-underline:
要編集
label:
要編集
accel-path:
要編集
submenu:
要編集
right-justified:
要編集

シグナル

select: self
上位クラス(ancestors)のページに要移動?
  • self: the object which received the signal.
deselect: self
上位クラス(ancestors)のページに要移動?
  • self: the object which received the signal.
activate: self
Emitted when the item is activated.
  • self: the object which received the signal.
activate-item: self
Emitted when the item is activated, but also if the menu item has a submenu. For normal applications, the relevant signal is "activate".
  • self: the object which received the signal.
toggle-size-allocate: self, allocation
  • self: the object which received the signal.
  • allocation: the allocation to use as signal data.
toggle-size-request: self, requisition
  • self: the object which received the signal.
  • requisition: the requisition to use as signal data.

関連ページ

更新履歴

  • 2014-06-16 クラスのメンバ項目の存在チェック("存在しない?"or"上位クラスのページに要移動?"とマーク)。リストから漏れているものを追加。 - きたがわ
  • - Masao?