Trait ux::LayoutManagerExt[][src]

pub trait LayoutManagerExt: 'static {
    pub fn allocate<P>(
        &self,
        container: &P,
        allocation: &ActorBox,
        flags: AllocationFlags
    )
    where
        P: IsA<Container>
;
pub fn child_get_property<P, Q>(
        &self,
        container: &P,
        actor: &Q,
        property_name: &str,
        value: &mut Value
    )
    where
        P: IsA<Container>,
        Q: IsA<Actor>
;
pub fn child_set_property<P, Q>(
        &self,
        container: &P,
        actor: &Q,
        property_name: &str,
        value: &Value
    )
    where
        P: IsA<Container>,
        Q: IsA<Actor>
;
pub fn find_child_property(&self, name: &str) -> Option<ParamSpec>;
pub fn get_child_meta<P, Q>(
        &self,
        container: &P,
        actor: &Q
    ) -> Option<LayoutMeta>
    where
        P: IsA<Container>,
        Q: IsA<Actor>
;
pub fn get_preferred_height<P>(
        &self,
        container: &P,
        for_width: f32
    ) -> (f32, f32)
    where
        P: IsA<Container>
;
pub fn get_preferred_width<P>(
        &self,
        container: &P,
        for_height: f32
    ) -> (f32, f32)
    where
        P: IsA<Container>
;
pub fn layout_changed(&self);
pub fn list_child_properties(&self) -> Vec<ParamSpec, Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
;
pub fn set_container<P>(&self, container: Option<&P>)
    where
        P: IsA<Container>
;
pub fn connect_layout_changed<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
; }

Trait containing all LayoutManager methods.

Implementors

BinLayout, BoxLayout, FixedLayout, FlowLayout, GridLayout, LayoutManager

Required methods

pub fn allocate<P>(
    &self,
    container: &P,
    allocation: &ActorBox,
    flags: AllocationFlags
) where
    P: IsA<Container>, 
[src]

Allocates the children of container given an area

See also ActorExt::allocate

container

the Container using self

allocation

the ActorBox containing the allocated area of container

flags

the allocation flags

pub fn child_get_property<P, Q>(
    &self,
    container: &P,
    actor: &Q,
    property_name: &str,
    value: &mut Value
) where
    P: IsA<Container>,
    Q: IsA<Actor>, 
[src]

Gets a property on the LayoutMeta created by self and attached to a child of container

The gobject::Value must already be initialized to the type of the property and has to be unset with gobject::Value::unset after extracting the real value out of it

container

a Container using self

actor

a Actor child of container

property_name

the name of the property to get

value

a gobject::Value with the value of the property to get

pub fn child_set_property<P, Q>(
    &self,
    container: &P,
    actor: &Q,
    property_name: &str,
    value: &Value
) where
    P: IsA<Container>,
    Q: IsA<Actor>, 
[src]

Sets a property on the LayoutMeta created by self and attached to a child of container

container

a Container using self

actor

a Actor child of container

property_name

the name of the property to set

value

a gobject::Value with the value of the property to set

pub fn find_child_property(&self, name: &str) -> Option<ParamSpec>[src]

Retrieves the gobject::ParamSpec for the layout property name inside the LayoutMeta sub-class used by self

name

the name of the property

Returns

a gobject::ParamSpec describing the property, or None if no property with that name exists. The returned gobject::ParamSpec is owned by the layout manager and should not be modified or freed

pub fn get_child_meta<P, Q>(
    &self,
    container: &P,
    actor: &Q
) -> Option<LayoutMeta> where
    P: IsA<Container>,
    Q: IsA<Actor>, 
[src]

Retrieves the LayoutMeta that the layout self associated to the actor child of container, eventually by creating one if the LayoutManager supports layout properties

container

a Container using self

actor

a Actor child of container

Returns

a LayoutMeta, or None if the LayoutManager does not have layout properties. The returned layout meta instance is owned by the LayoutManager and it should not be unreferenced

pub fn get_preferred_height<P>(
    &self,
    container: &P,
    for_width: f32
) -> (f32, f32) where
    P: IsA<Container>, 
[src]

Computes the minimum and natural heights of the container according to self.

See also ActorExt::get_preferred_height

container

the Container using self

for_width

the width for which the height should be computed, or -1

min_height_p

return location for the minimum height of the layout, or None

nat_height_p

return location for the natural height of the layout, or None

pub fn get_preferred_width<P>(
    &self,
    container: &P,
    for_height: f32
) -> (f32, f32) where
    P: IsA<Container>, 
[src]

Computes the minimum and natural widths of the container according to self.

See also ActorExt::get_preferred_width

container

the Container using self

for_height

the height for which the width should be computed, or -1

min_width_p

return location for the minimum width of the layout, or None

nat_width_p

return location for the natural width of the layout, or None

pub fn layout_changed(&self)[src]

Emits the LayoutManager::layout-changed signal on self

This function should only be called by implementations of the LayoutManager class

pub fn list_child_properties(&self) -> Vec<ParamSpec, Global>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Retrieves all the gobject::ParamSpecs for the layout properties stored inside the LayoutMeta sub-class used by self

n_pspecs

return location for the number of returned gobject::ParamSpecs

Returns

the newly-allocated, None-terminated array of gobject::ParamSpecs. Use g_free to free the resources allocated for the array

pub fn set_container<P>(&self, container: Option<&P>) where
    P: IsA<Container>, 
[src]

If the LayoutManager sub-class allows it, allow adding a weak reference of the container using self from within the layout manager

The layout manager should not increase the reference count of the container

container

a Container using self

pub fn connect_layout_changed<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

The ::layout-changed signal is emitted each time a layout manager has been changed. Every Actor using the manager instance as a layout manager should connect a handler to the ::layout-changed signal and queue a relayout on themselves:

  static void layout_changed (LayoutManager *manager,
                              Actor         *self)
  {
    actor_queue_relayout (self);
  }
  ...
    self->manager = g_object_ref_sink (manager);
    g_signal_connect (self->manager, "layout-changed",
                      G_CALLBACK (layout_changed),
                      self);

Sub-classes of LayoutManager that implement a layout that can be controlled or changed using parameters should emit the ::layout-changed signal whenever one of the parameters changes, by using LayoutManagerExt::layout_changed.

Loading content...

Implementors

impl<O> LayoutManagerExt for O where
    O: IsA<LayoutManager>, 
[src]

Loading content...