gtk4::prelude

Trait FrameExt

Source
pub trait FrameExt: IsA<Frame> + 'static {
    // Provided methods
    fn child(&self) -> Option<Widget> { ... }
    fn label(&self) -> Option<GString> { ... }
    fn label_align(&self) -> f32 { ... }
    fn label_widget(&self) -> Option<Widget> { ... }
    fn set_child(&self, child: Option<&impl IsA<Widget>>) { ... }
    fn set_label(&self, label: Option<&str>) { ... }
    fn set_label_align(&self, xalign: f32) { ... }
    fn set_label_widget(&self, label_widget: Option<&impl IsA<Widget>>) { ... }
    fn connect_child_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_label_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_label_widget_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_label_xalign_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Frame methods.

§Implementors

Frame

Provided Methods§

Source

fn child(&self) -> Option<Widget>

Gets the child widget of @self.

§Returns

the child widget of @self

Source

fn label(&self) -> Option<GString>

Returns the frame labels text.

If the frame’s label widget is not a Label, None is returned.

§Returns

the text in the label, or None if there was no label widget or the label widget was not a Label. This string is owned by GTK and must not be modified or freed.

Source

fn label_align(&self) -> f32

Retrieves the X alignment of the frame’s label.

§Returns

the frames X alignment

Source

fn label_widget(&self) -> Option<Widget>

Retrieves the label widget for the frame.

§Returns

the label widget

Source

fn set_child(&self, child: Option<&impl IsA<Widget>>)

Sets the child widget of @self.

§child

the child widget

Source

fn set_label(&self, label: Option<&str>)

Creates a new Label with the @label and sets it as the frame’s label widget.

§label

the text to use as the label of the frame

Source

fn set_label_align(&self, xalign: f32)

Sets the X alignment of the frame widget’s label.

The default value for a newly created frame is 0.0.

§xalign

The position of the label along the top edge of the widget. A value of 0.0 represents left alignment; 1.0 represents right alignment.

Source

fn set_label_widget(&self, label_widget: Option<&impl IsA<Widget>>)

Sets the label widget for the frame.

This is the widget that will appear embedded in the top edge of the frame as a title.

§label_widget

the new label widget

Source

fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_label_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_label_xalign_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<O: IsA<Frame>> FrameExt for O