gtk4::prelude

Trait FixedExt

Source
pub trait FixedExt: IsA<Fixed> + 'static {
    // Provided methods
    fn child_position(&self, widget: &impl IsA<Widget>) -> (f64, f64) { ... }
    fn child_transform(&self, widget: &impl IsA<Widget>) -> Option<Transform> { ... }
    fn move_(&self, widget: &impl IsA<Widget>, x: f64, y: f64) { ... }
    fn put(&self, widget: &impl IsA<Widget>, x: f64, y: f64) { ... }
    fn remove(&self, widget: &impl IsA<Widget>) { ... }
    fn set_child_transform(
        &self,
        widget: &impl IsA<Widget>,
        transform: Option<&Transform>,
    ) { ... }
}
Expand description

Trait containing all Fixed methods.

§Implementors

Fixed

Provided Methods§

Source

fn child_position(&self, widget: &impl IsA<Widget>) -> (f64, f64)

Retrieves the translation transformation of the given child Widget in the Fixed.

See also: child_transform().

§widget

a child of @self

§Returns
§x

the horizontal position of the @widget

§y

the vertical position of the @widget

Source

fn child_transform(&self, widget: &impl IsA<Widget>) -> Option<Transform>

Retrieves the transformation for @widget set using gtk_fixed_set_child_transform().

§widget

a Widget, child of @self

§Returns

a gsk::Transform

Source

fn move_(&self, widget: &impl IsA<Widget>, x: f64, y: f64)

Sets a translation transformation to the given @x and @y coordinates to the child @widget of the Fixed.

§widget

the child widget

§x

the horizontal position to move the widget to

§y

the vertical position to move the widget to

Source

fn put(&self, widget: &impl IsA<Widget>, x: f64, y: f64)

Adds a widget to a Fixed at the given position.

§widget

the widget to add

§x

the horizontal position to place the widget at

§y

the vertical position to place the widget at

Source

fn remove(&self, widget: &impl IsA<Widget>)

Removes a child from @self.

§widget

the child widget to remove

Source

fn set_child_transform( &self, widget: &impl IsA<Widget>, transform: Option<&Transform>, )

Sets the transformation for @widget.

This is a convenience function that retrieves the FixedLayoutChild instance associated to @widget and calls FixedLayoutChild::set_transform().

§widget

a Widget, child of @self

§transform

the transformation assigned to @widget to reset @widget’s transform

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<Fixed>> FixedExt for O