[−][src]Trait gtk::GtkMenuItemExt
Required methods
fn deselect(&self)
Emits the MenuItem::deselect
signal on the given item.
fn get_accel_path(&self) -> Option<GString>
Retrieve the accelerator path that was previously set on self
.
See GtkMenuItemExt::set_accel_path
for details.
Returns
the accelerator path corresponding to
this menu item’s functionality, or None
if not set
fn get_label(&self) -> Option<GString>
Sets text
on the self
label
Returns
The text in the self
label. This is the internal
string used by the label, and must not be modified.
fn get_reserve_indicator(&self) -> bool
Returns whether the self
reserves space for
the submenu indicator, regardless if it has a submenu
or not.
Returns
true
if self
always reserves space for the
submenu indicator
fn get_submenu(&self) -> Option<Widget>
Gets the submenu underneath this menu item, if any.
See GtkMenuItemExt::set_submenu
.
Returns
submenu for this menu item, or None
if none
fn get_use_underline(&self) -> bool
Checks if an underline in the text indicates the next character should be used for the mnemonic accelerator key.
Returns
true
if an embedded underline in the label
indicates the mnemonic accelerator key.
fn select(&self)
Emits the MenuItem::select
signal on the given item.
fn set_accel_path(&self, accel_path: Option<&str>)
Set the accelerator path on self
, through which runtime
changes of the menu item’s accelerator caused by the user can be
identified and saved to persistent storage (see AccelMap::save
on this). To set up a default accelerator for this menu item, call
AccelMap::add_entry
with the same accel_path
. See also
AccelMap::add_entry
on the specifics of accelerator paths,
and GtkMenuExt::set_accel_path
for a more convenient variant of
this function.
This function is basically a convenience wrapper that handles
calling WidgetExt::set_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
GtkMenuExt::set_accel_group
for this to work.
Note that accel_path
string will be stored in a glib::Quark
.
Therefore, if you pass a static string, you can save some memory
by interning it first with g_intern_static_string
.
accel_path
accelerator path, corresponding to this menu
item’s functionality, or None
to unset the current path.
fn set_label(&self, label: &str)
fn set_reserve_indicator(&self, reserve: bool)
Sets whether the self
should reserve space for
the submenu indicator, regardless if it actually has
a submenu or not.
There should be little need for applications to call this functions.
reserve
the new value
fn set_submenu<P: IsA<Menu>>(&self, submenu: Option<&P>)
Sets or replaces the menu item’s submenu, or removes it when a None
submenu is passed.
submenu
the submenu, or None
fn set_use_underline(&self, setting: bool)
If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.
setting
true
if underlines in the text indicate mnemonics
fn toggle_size_allocate(&self, allocation: i32)
Emits the MenuItem::toggle-size-allocate
signal on the given item.
allocation
the allocation to use as signal data.
fn toggle_size_request(&self, requisition: &mut i32)
Emits the MenuItem::toggle-size-request
signal on the given item.
requisition
the requisition to use as signal data.
fn get_property_right_justified(&self) -> bool
Sets whether the menu item appears justified at the right side of a menu bar.
fn set_property_right_justified(&self, right_justified: bool)
Sets whether the menu item appears justified at the right side of a menu bar.
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the item is activated.
fn emit_activate(&self)
fn connect_activate_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the item is activated, but also if the menu item has a
submenu. For normal applications, the relevant signal is
MenuItem::activate
.
fn connect_deselect<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_select<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_toggle_size_allocate<F: Fn(&Self, i32) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_accel_path_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_label_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_right_justified_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_submenu_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_use_underline_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
Implementors
impl<O: IsA<MenuItem>> GtkMenuItemExt for O
[src]
fn deselect(&self)
[src]
fn get_accel_path(&self) -> Option<GString>
[src]
fn get_label(&self) -> Option<GString>
[src]
fn get_reserve_indicator(&self) -> bool
[src]
fn get_submenu(&self) -> Option<Widget>
[src]
fn get_use_underline(&self) -> bool
[src]
fn select(&self)
[src]
fn set_accel_path(&self, accel_path: Option<&str>)
[src]
fn set_label(&self, label: &str)
[src]
fn set_reserve_indicator(&self, reserve: bool)
[src]
fn set_submenu<P: IsA<Menu>>(&self, submenu: Option<&P>)
[src]
fn set_use_underline(&self, setting: bool)
[src]
fn toggle_size_allocate(&self, allocation: i32)
[src]
fn toggle_size_request(&self, requisition: &mut i32)
[src]
fn get_property_right_justified(&self) -> bool
[src]
fn set_property_right_justified(&self, right_justified: bool)
[src]
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
[src]
fn emit_activate(&self)
[src]
fn connect_activate_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
[src]
fn connect_deselect<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
[src]
fn connect_select<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
[src]
fn connect_toggle_size_allocate<F: Fn(&Self, i32) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_accel_path_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_label_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_right_justified_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_submenu_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_use_underline_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId