[][src]Trait gtk::ButtonExt

pub trait ButtonExt {
    fn clicked(&self);
fn get_alignment(&self) -> (f32, f32);
fn get_always_show_image(&self) -> bool;
fn get_event_window(&self) -> Option<Window>;
fn get_focus_on_click(&self) -> bool;
fn get_image(&self) -> Option<Widget>;
fn get_image_position(&self) -> PositionType;
fn get_label(&self) -> Option<String>;
fn get_relief(&self) -> ReliefStyle;
fn get_use_stock(&self) -> bool;
fn get_use_underline(&self) -> bool;
fn set_alignment(&self, xalign: f32, yalign: f32);
fn set_always_show_image(&self, always_show: bool);
fn set_focus_on_click(&self, focus_on_click: bool);
fn set_image<'a, P: IsA<Widget> + 'a, Q: Into<Option<&'a P>>>(
        &self,
        image: Q
    );
fn set_image_position(&self, position: PositionType);
fn set_label(&self, label: &str);
fn set_relief(&self, relief: ReliefStyle);
fn set_use_stock(&self, use_stock: bool);
fn set_use_underline(&self, use_underline: bool);
fn get_property_xalign(&self) -> f32;
fn set_property_xalign(&self, xalign: f32);
fn get_property_yalign(&self) -> f32;
fn set_property_yalign(&self, yalign: f32);
fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_activate(&self);
fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn emit_clicked(&self);
fn connect_property_always_show_image_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_image_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_image_position_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_label_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_relief_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_use_stock_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_use_underline_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_xalign_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_yalign_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all Button methods.

Implementors

Button, ColorButton, FontButton, LinkButton, ModelButton, ScaleButton, ToggleButton

Required Methods

Emits a Button::clicked signal to the given Button.

Gets the alignment of the child in the button.

Deprecated since 3.14

Access the child widget directly if you need to control its alignment.

xalign

return location for horizontal alignment

yalign

return location for vertical alignment

Returns whether the button will ignore the Settings:gtk-button-images setting and always show the image, if available.

Feature: v3_6

Returns

true if the button will always show the image

Returns the button’s event window if it is realized, None otherwise. This function should be rarely needed.

Returns

self’s event window.

Returns whether the button grabs focus when it is clicked with the mouse. See ButtonExt::set_focus_on_click.

Deprecated since 3.20

Use WidgetExt::get_focus_on_click instead

Returns

true if the button grabs focus when it is clicked with the mouse.

Gets the widget that is currenty set as the image of self. This may have been explicitly set by ButtonExt::set_image or constructed by Button::new_from_stock.

Returns

a Widget or None in case there is no image

Gets the position of the image relative to the text inside the button.

Returns

the position

Fetches the text from the label of the button, as set by ButtonExt::set_label. If the label text has not been set the return value will be None. This will be the case if you create an empty button with Button::new to use as a container.

Returns

The text of the label widget. This string is owned by the widget and must not be modified or freed.

Returns the current relief style of the given Button.

Returns

The current ReliefStyle

Returns whether the button label is a stock item.

Deprecated since 3.10

Returns

true if the button label is used to select a stock item instead of being used directly as the label text.

Returns whether an embedded underline in the button label indicates a mnemonic. See gtk_button_set_use_underline ().

Returns

true if an embedded underline in the button label indicates the mnemonic accelerator keys.

Sets the alignment of the child. This property has no effect unless the child is a Misc or a Alignment.

Deprecated since 3.14

Access the child widget directly if you need to control its alignment.

xalign

the horizontal position of the child, 0.0 is left aligned, 1.0 is right aligned

yalign

the vertical position of the child, 0.0 is top aligned, 1.0 is bottom aligned

If true, the button will ignore the Settings:gtk-button-images setting and always show the image, if available.

Use this property if the button would be useless or hard to use without the image.

Feature: v3_6

always_show

true if the menuitem should always show the image

Sets whether the button will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

Deprecated since 3.20

Use WidgetExt::set_focus_on_click instead

focus_on_click

whether the button grabs focus when clicked with the mouse

Set the image of self to the given widget. The image will be displayed if the label text is None or if Button:always-show-image is true. You don’t have to call WidgetExt::show on image yourself.

image

a widget to set as the image for the button

Sets the position of the image relative to the text inside the button.

position

the position

Sets the text of the label of the button to str. This text is also used to select the stock item if ButtonExt::set_use_stock is used.

This will also clear any previously set labels.

label

a string

Sets the relief style of the edges of the given Button widget. Two styles exist, ReliefStyle::Normal and ReliefStyle::None. The default style is, as one can guess, ReliefStyle::Normal. The deprecated value ReliefStyle::Half behaves the same as ReliefStyle::Normal.

relief

The ReliefStyle as described above

If true, the label set on the button is used as a stock id to select the stock item for the button.

Deprecated since 3.10

use_stock

true if the button should use a stock item

If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.

use_underline

true if underlines in the text indicate mnemonics

If the child of the button is a Misc or Alignment, this property can be used to control its horizontal alignment. 0.0 is left aligned, 1.0 is right aligned.

Deprecated since 3.14

Access the child widget directly if you need to control its alignment.

If the child of the button is a Misc or Alignment, this property can be used to control its horizontal alignment. 0.0 is left aligned, 1.0 is right aligned.

Deprecated since 3.14

Access the child widget directly if you need to control its alignment.

If the child of the button is a Misc or Alignment, this property can be used to control its vertical alignment. 0.0 is top aligned, 1.0 is bottom aligned.

Deprecated since 3.14

Access the child widget directly if you need to control its alignment.

If the child of the button is a Misc or Alignment, this property can be used to control its vertical alignment. 0.0 is top aligned, 1.0 is bottom aligned.

Deprecated since 3.14

Access the child widget directly if you need to control its alignment.

The ::activate signal on Button is an action signal and emitting it causes the button to animate press then release. Applications should never connect to this signal, but use the Button::clicked signal.

Emitted when the button has been activated (pressed and released).

Implementors

impl<O: IsA<Button> + IsA<Object> + ObjectExt> ButtonExt for O
[src]