pub trait FactoryView<Widget> {
    type Root: Debug;
    type Position;

    // Required methods
    fn add(&self, widget: &Widget, position: &Self::Position) -> Self::Root;
    fn remove(&self, widget: &Self::Root);
}
Expand description

A trait implemented for GTK4 widgets that allows a factory to create and remove widgets.

Required Associated Types§

source

type Root: Debug

Widget type that’s stored inside a factory data type.

source

type Position

Position type used by this widget.

For example GridPosition for gtk::Grid or () for gtk::Box

Required Methods§

source

fn add(&self, widget: &Widget, position: &Self::Position) -> Self::Root

Adds a new widget to self at the end.

source

fn remove(&self, widget: &Self::Root)

Removes a widget from self at the end.

Implementations on Foreign Types§

source§

impl<Widget> FactoryView<Widget> for ListBoxwhere Widget: IsA<Widget>,

§

type Position = ()

§

type Root = Widget

source§

fn add(&self, widget: &Widget, _position: &()) -> Widget

source§

fn remove(&self, widget: &Widget)

§

type Position = ()

§

type Root = Widget

source§

fn add(&self, widget: &Widget, _position: &Self::Position) -> Widget

source§

fn remove(&self, widget: &Widget)

source§

impl<Widget> FactoryView<Widget> for ViewStackwhere Widget: IsA<Widget>,

Available on crate feature libadwaita only.
§

type Position = StackPageInfo

§

type Root = Widget

source§

fn add(&self, widget: &Widget, position: &StackPageInfo) -> Widget

source§

fn remove(&self, widget: &Widget)

source§

impl FactoryView<TreeViewColumn> for TreeView

§

type Position = ()

§

type Root = TreeViewColumn

source§

fn add(&self, widget: &TreeViewColumn, _position: &()) -> TreeViewColumn

source§

fn remove(&self, widget: &TreeViewColumn)

source§

impl<Widget> FactoryView<Widget> for Leafletwhere Widget: IsA<Widget>,

Available on crate feature libadwaita only.
§

type Position = ()

§

type Root = LeafletPage

source§

fn add(&self, widget: &Widget, _position: &()) -> LeafletPage

source§

fn remove(&self, widget: &LeafletPage)

source§

impl<Widget> FactoryView<Widget> for Boxwhere Widget: IsA<Widget>,

§

type Position = ()

§

type Root = Widget

source§

fn add(&self, widget: &Widget, _position: &()) -> Widget

source§

fn remove(&self, widget: &Widget)

source§

impl<Widget> FactoryView<Widget> for Stackwhere Widget: IsA<Widget>,

§

type Position = StackPageInfo

§

type Root = Widget

source§

fn add(&self, widget: &Widget, position: &StackPageInfo) -> Widget

source§

fn remove(&self, widget: &Widget)

source§

impl<Widget> FactoryView<Widget> for Panedwhere Widget: IsA<Widget>,

Available on crate feature libpanel only.
§

type Position = ()

§

type Root = Widget

source§

fn add(&self, widget: &Widget, _position: &Self::Position) -> Widget

source§

fn remove(&self, widget: &Widget)

source§

impl<Widget> FactoryView<Widget> for FlowBoxwhere Widget: IsA<Widget>,

§

type Position = ()

§

type Root = Widget

source§

fn add(&self, widget: &Widget, _position: &()) -> Widget

source§

fn remove(&self, widget: &Widget)

source§

impl<Widget> FactoryView<Widget> for TabViewwhere Widget: IsA<Widget>,

Available on crate feature libadwaita only.
§

type Position = TabPageInfo

§

type Root = TabPage

source§

fn add(&self, widget: &Widget, position: &TabPageInfo) -> TabPage

source§

fn remove(&self, widget: &TabPage)

source§

impl<Widget> FactoryView<Widget> for Fixedwhere Widget: IsA<Widget>,

§

type Position = FixedPosition

§

type Root = Widget

source§

fn add(&self, widget: &Widget, position: &FixedPosition) -> Widget

source§

fn remove(&self, widget: &Widget)

source§

impl<Widget> FactoryView<Widget> for Gridwhere Widget: IsA<Widget>,

§

type Position = GridPosition

§

type Root = Widget

source§

fn add(&self, widget: &Widget, position: &GridPosition) -> Widget

source§

fn remove(&self, widget: &Widget)

Implementors§