gtk4::subclass::layout_manager

Trait LayoutManagerImpl

Source
pub trait LayoutManagerImpl: LayoutManagerImplExt + ObjectImpl {
    // Provided methods
    fn allocate(&self, widget: &Widget, width: i32, height: i32, baseline: i32) { ... }
    fn create_layout_child(
        &self,
        widget: &Widget,
        for_child: &Widget,
    ) -> LayoutChild { ... }
    fn layout_child_type() -> Option<Type> { ... }
    fn request_mode(&self, widget: &Widget) -> SizeRequestMode { ... }
    fn measure(
        &self,
        widget: &Widget,
        orientation: Orientation,
        for_size: i32,
    ) -> (i32, i32, i32, i32) { ... }
    fn root(&self) { ... }
    fn unroot(&self) { ... }
}

Provided Methods§

Source

fn allocate(&self, widget: &Widget, width: i32, height: i32, baseline: i32)

Assigns the given @width, @height, and @baseline to a @widget, and computes the position and sizes of the children of the @widget using the layout management policy of @self.

§widget

the Widget using @self

§width

the new width of the @widget

§height

the new height of the @widget

§baseline

the baseline position of the @widget, or -1

Source

fn create_layout_child( &self, widget: &Widget, for_child: &Widget, ) -> LayoutChild

Create a LayoutChild instance for the given @for_child widget.

§widget

the widget using the @self

§for_child

the child of @widget

§Returns

a LayoutChild

Source

fn layout_child_type() -> Option<Type>

Only set if the child implemented LayoutChildImpl

Source

fn request_mode(&self, widget: &Widget) -> SizeRequestMode

a virtual function, used to return the preferred request mode for the layout manager; for instance, “width for height” or “height for width”; see SizeRequestMode

Source

fn measure( &self, widget: &Widget, orientation: Orientation, for_size: i32, ) -> (i32, i32, i32, i32)

Measures the size of the @widget using @self, for the given @orientation and size.

See the Widget documentation on layout management for more details.

§widget

the Widget using @self

§orientation

the orientation to measure

§for_size

Size for the opposite of @orientation; for instance, if the @orientation is Orientation::Horizontal, this is the height of the widget; if the @orientation is Orientation::Vertical, this is the width of the widget. This allows to measure the height for the given width, and the width for the given height. Use -1 if the size is not known

§Returns
§minimum

the minimum size for the given size and orientation

§natural

the natural, or preferred size for the given size and orientation

§minimum_baseline

the baseline position for the minimum size

§natural_baseline

the baseline position for the natural size

Source

fn root(&self)

a virtual function, called when the widget using the layout manager is attached to a Root

Source

fn unroot(&self)

a virtual function, called when the widget using the layout manager is detached from a Root

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§