libadwaita

Struct WrapLayout

source
pub struct WrapLayout { /* private fields */ }
Available on crate feature v1_7 only.
Expand description

A box-like layout that can wrap into multiple lines.

wrap-box

WrapLayout is similar to Gtk::BoxLayout, but can wrap lines when the widgets cannot fit otherwise. Unlike Gtk::FlowBox, the children aren’t arranged into a grid and behave more like words in a wrapping label.

Like GtkBoxLayout, WrapLayout is orientable and has spacing:

::: note Unlike GtkBoxLayout, WrapLayout cannot follow the CSS border-spacing property.

Use the natural-line-length property to determine the layout’s natural size, e.g. when using it in a gtk::Popover.

Normally, a horizontal WrapLayout wraps left to right and top to bottom for left-to-right languages. Both of these directions can be reversed, using the pack-direction and wrap-reverse properties. Additionally, the alignment of each line can be controlled with the align property.

Lines can be justified using the justify property, filling the entire line by either increasing child size or spacing depending on the value. Set justify-last-line to justify the last line as well.

By default, WrapLayout wraps as soon as the previous line cannot fit any more children without shrinking them past their natural size. Set wrap-policy to [enum@Adw.WrapPolicy.MINIMUM] to only wrap once all the children in the previous line have been shrunk to their minimum size.

To make each line take the same amount of space, set line-homogeneous to TRUE.

Spacing and natural line length can scale with the text scale factor, use the child-spacing-unit, line-spacing-unit and/or natural-line-length-unit properties to enable that behavior.

See WrapBox.

§Properties

§align

The alignment of the children within each line.

0 means the children are placed at the start of the line, 1 means they are placed at the end of the line. 0.5 means they are placed in the middle of the line.

Alignment is only used when justify is set to ADW_JUSTIFY_NONE, or on the last line when the justify-last-line is FALSE.

Readable | Writeable

§child-spacing

The spacing between widgets on the same line.

See child-spacing-unit.

Readable | Writeable

§child-spacing-unit

The length unit for child spacing.

Allows the spacing to vary depending on the text scale factor.

See child-spacing.

Readable | Writeable

§justify

Determines whether and how each complete line should be stretched to fill the entire widget.

If set to ADW_JUSTIFY_FILL, each widget in the line will be stretched, keeping consistent spacing, so that the line fills the entire widget.

If set to ADW_JUSTIFY_SPREAD, the spacing between widgets will be increased, keeping widget sizes intact. The first and last widget will be aligned with the beginning and end of the line. If the line only contains a single widget, it will be stretched regardless.

If set to ADW_JUSTIFY_NONE, the line will not be stretched and the children will be placed together within the line, according to align.

By default this doesn’t affect the last line, as it will be incomplete. Use justify-last-line to justify it as well.

Readable | Writeable

§justify-last-line

Whether the last line should be stretched to fill the entire widget.

See justify.

Readable | Writeable

§line-homogeneous

Whether all lines should take the same amount of space.

Readable | Writeable

§line-spacing

The spacing between lines.

See line-spacing-unit.

Readable | Writeable

§line-spacing-unit

The length unit for line spacing.

Allows the spacing to vary depending on the text scale factor.

See line-spacing.

Readable | Writeable

§natural-line-length

Determines the natural size for each line.

It should be used to limit the line lengths, for example when used in popovers.

See natural-line-length-unit.

Readable | Writeable

§natural-line-length-unit

The length unit for natural line length.

Allows the length to vary depending on the text scale factor.

See natural-line-length.

Readable | Writeable

§pack-direction

The direction children are packed in each line.

Readable | Writeable

§wrap-policy

Whether wrap direction should be reversed.

By default, lines wrap downwards in a horizontal box, and towards the end in a vertical box. If set to TRUE, they wrap upwards or towards the start respectively.

Readable | Writeable

§wrap-reverse

Whether wrap direction should be reversed.

By default, lines wrap downwards in a horizontal box, and towards the end in a vertical box. If set to TRUE, they wrap upwards or towards the start respectively.

Readable | Writeable

Orientable

§orientation

The orientation of the orientable.

Readable | Writeable

§Implements

gtk::prelude::LayoutManagerExt, [trait@glib::ObjectExt], gtk::prelude::OrientableExt

GLib type: GObject with reference counted clone semantics.

Implementations§

source§

impl WrapLayout

source

pub fn new() -> WrapLayout

Creates a new WrapLayout.

§Returns

the newly created WrapLayout

source

pub fn builder() -> WrapLayoutBuilder

Creates a new builder-pattern struct instance to construct WrapLayout objects.

This method returns an instance of WrapLayoutBuilder which can be used to create WrapLayout objects.

source

pub fn align(&self) -> f32

Gets the alignment of the children within each line.

§Returns

the child alignment

source

pub fn child_spacing(&self) -> i32

Gets spacing between widgets on the same line.

§Returns

spacing between widgets on the same line

source

pub fn child_spacing_unit(&self) -> LengthUnit

Gets the length unit for child spacing.

§Returns

the length unit

source

pub fn justify(&self) -> JustifyMode

Gets whether and how each complete line is stretched to fill the entire widget.

§Returns

the justify mode

source

pub fn is_justify_last_line(&self) -> bool

Gets whether the last line should be stretched to fill the entire widget.

§Returns

whether the last line is justified

source

pub fn is_line_homogeneous(&self) -> bool

Gets whether all lines should take the same amount of space.

§Returns

whether lines should be homogeneous

source

pub fn line_spacing(&self) -> i32

Gets the spacing between lines.

§Returns

the line spacing

source

pub fn line_spacing_unit(&self) -> LengthUnit

Gets the length unit for line spacing.

§Returns

the length unit

source

pub fn natural_line_length(&self) -> i32

Gets the natural size for each line.

§Returns

the natural length

source

pub fn natural_line_length_unit(&self) -> LengthUnit

Gets the length unit for line spacing.

§Returns

the length unit

source

pub fn pack_direction(&self) -> PackDirection

Gets the direction children are packed in each line.

§Returns

the line direction

source

pub fn wrap_policy(&self) -> WrapPolicy

Gets the policy for line wrapping.

§Returns

the wrap policy

source

pub fn wraps_reverse(&self) -> bool

Gets whether wrap direction is reversed.

§Returns

whether wrap direction is reversed

source

pub fn set_align(&self, align: f32)

Sets the alignment of the children within each line.

0 means the children are placed at the start of the line, 1 means they are placed at the end of the line. 0.5 means they are placed in the middle of the line.

Alignment is only used when justify is set to ADW_JUSTIFY_NONE, or on the last line when the justify-last-line is FALSE.

§align

the child alignment

source

pub fn set_child_spacing(&self, child_spacing: i32)

Sets the spacing between widgets on the same line.

See child-spacing-unit.

§child_spacing

the child spacing

source

pub fn set_child_spacing_unit(&self, unit: LengthUnit)

Sets the length unit for child spacing.

Allows the spacing to vary depending on the text scale factor.

See child-spacing.

§unit

the length unit

source

pub fn set_justify(&self, justify: JustifyMode)

Sets whether and how each complete line should be stretched to fill the entire widget.

If set to ADW_JUSTIFY_FILL, each widget in the line will be stretched, keeping consistent spacing, so that the line fills the entire widget.

If set to ADW_JUSTIFY_SPREAD, the spacing between widgets will be increased, keeping widget sizes intact. The first and last widget will be aligned with the beginning and end of the line. If the line only contains a single widget, it will be stretched regardless.

If set to ADW_JUSTIFY_NONE, the line will not be stretched and the children will be placed together within the line, according to align.

By default this doesn’t affect the last line, as it will be incomplete. Use justify-last-line to justify it as well.

§justify

the justify mode

source

pub fn set_justify_last_line(&self, justify_last_line: bool)

Sets whether the last line should be stretched to fill the entire widget.

See justify.

§justify_last_line

whether to justify the last line

source

pub fn set_line_homogeneous(&self, homogeneous: bool)

Sets whether all lines should take the same amount of space.

§homogeneous

whether lines should be homogeneous

source

pub fn set_line_spacing(&self, line_spacing: i32)

Sets the spacing between lines.

See line-spacing-unit.

§line_spacing

the line spacing

source

pub fn set_line_spacing_unit(&self, unit: LengthUnit)

Sets the length unit for line spacing.

Allows the spacing to vary depending on the text scale factor.

See line-spacing.

§unit

the length unit

source

pub fn set_natural_line_length(&self, natural_line_length: i32)

Sets the natural size for each line.

It should be used to limit the line lengths, for example when used in popovers.

See natural-line-length-unit.

§natural_line_length

the natural length

source

pub fn set_natural_line_length_unit(&self, unit: LengthUnit)

Sets the length unit for natural line length.

Allows the length to vary depending on the text scale factor.

See natural-line-length.

§unit

the length unit

source

pub fn set_pack_direction(&self, pack_direction: PackDirection)

Sets the direction children are packed in each line.

§pack_direction

the new line direction

source

pub fn set_wrap_policy(&self, wrap_policy: WrapPolicy)

Sets the policy for line wrapping.

If set to ADW_WRAP_NATURAL, the box will wrap to the next line as soon as the previous line cannot fit any more children without shrinking them past their natural size.

If set to ADW_WRAP_MINIMUM, the box will try to fit as many children into each line as possible, shrinking them down to their minimum size before wrapping to the next line.

§wrap_policy

the new wrap policy

source

pub fn set_wrap_reverse(&self, wrap_reverse: bool)

Sets whether wrap direction should be reversed.

By default, lines wrap downwards in a horizontal box, and towards the end in a vertical box. If set to TRUE, they wrap upwards or towards the start respectively.

§wrap_reverse

whether to reverse wrap direction

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

Trait Implementations§

source§

impl Clone for WrapLayout

source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the object. Dropping the object will decrement it again.

1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WrapLayout

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for WrapLayout

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl HasParamSpec for WrapLayout

source§

type ParamSpec = ParamSpecObject

source§

type SetValue = WrapLayout

Preferred value to be used as setter for the associated ParamSpec.
source§

type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, WrapLayout>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for WrapLayout

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Hashes the memory address of this object.

1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for WrapLayout

source§

fn cmp(&self, other: &Self) -> Ordering

Comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
source§

impl ParentClassIs for WrapLayout

source§

impl<OT: ObjectType> PartialEq<OT> for WrapLayout

source§

fn eq(&self, other: &OT) -> bool

Equality for two GObjects.

Two GObjects are equal if their memory addresses are equal.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<OT: ObjectType> PartialOrd<OT> for WrapLayout

source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

Partial comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for WrapLayout

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Eq for WrapLayout

source§

impl IsA<LayoutManager> for WrapLayout

source§

impl IsA<Orientable> for WrapLayout

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Cast for T
where T: ObjectType,

source§

fn upcast<T>(self) -> T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
source§

fn upcast_ref<T>(&self) -> &T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
source§

fn downcast<T>(self) -> Result<T, Self>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a subclass or interface implementor T. Read more
source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
source§

fn dynamic_cast<T>(self) -> Result<T, Self>
where T: ObjectType,

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while upcast will do many checks at compile-time already. downcast will perform the same checks at runtime as dynamic_cast, but will also ensure some amount of compile-time safety. Read more
source§

fn dynamic_cast_ref<T>(&self) -> Option<&T>
where T: ObjectType,

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more
source§

unsafe fn unsafe_cast<T>(self) -> T
where T: ObjectType,

Casts to T unconditionally. Read more
source§

unsafe fn unsafe_cast_ref<T>(&self) -> &T
where T: ObjectType,

Casts to &T unconditionally. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

source§

impl<O> GObjectPropertyExpressionExt for O
where O: IsA<Object>,

source§

fn property_expression(&self, property_name: &str) -> PropertyExpression

Create an expression looking up an object’s property.
source§

fn property_expression_weak(&self, property_name: &str) -> PropertyExpression

Create an expression looking up an object’s property with a weak reference.
source§

fn this_expression(property_name: &str) -> PropertyExpression

Create an expression looking up a property in the bound this object.
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<U> IsSubclassableExt for U

source§

impl<O> LayoutManagerExt for O
where O: IsA<LayoutManager>,

source§

fn allocate( &self, widget: &impl IsA<Widget>, width: i32, height: i32, baseline: i32, )

source§

fn layout_child(&self, child: &impl IsA<Widget>) -> LayoutChild

source§

fn request_mode(&self) -> SizeRequestMode

source§

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

source§

fn layout_changed(&self)

source§

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

source§

impl<T> ObjectExt for T
where T: ObjectType,

source§

fn is<U>(&self) -> bool
where U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
source§

fn type_(&self) -> Type

Returns the type of the object.
source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
source§

fn class(&self) -> &Class<T>
where T: IsClass,

Returns the class of the object.
source§

fn class_of<U>(&self) -> Option<&Class<U>>
where U: IsClass,

Returns the class of the object in the given type T. Read more
source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>
where U: IsInterface,

Returns the interface T of the object. Read more
source§

fn set_property(&self, property_name: &str, value: impl Into<Value>)

Sets the property property_name of the object to value value. Read more
source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
source§

fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])

Sets multiple properties of the object at once. Read more
source§

fn set_properties_from_value(&self, property_values: &[(&str, Value)])

Sets multiple properties of the object at once. Read more
source§

fn property<V>(&self, property_name: &str) -> V
where V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
source§

fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool

Check if the object has a property property_name of the given type_. Read more
source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
source§

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Get the ParamSpec of the property property_name of this object.
source§

fn list_properties(&self) -> PtrSlice<ParamSpec>

Return all ParamSpec of the properties of this object.
source§

fn freeze_notify(&self) -> PropertyNotificationFreezeGuard

Freeze all property notifications until the return guard object is dropped. Read more
source§

unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
source§

fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)

Stop emission of the currently emitted signal.
source§

fn stop_signal_emission_by_name(&self, signal_name: &str)

Stop emission of the currently emitted signal by the (possibly detailed) signal name.
source§

fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
source§

fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_id on this object. Read more
source§

fn watch_closure(&self, closure: &impl AsRef<Closure>)

Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to invoke_with_values, or invoke when using Rust closures.
source§

fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R

Emit signal by signal id. Read more
source§

fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>

Same as Self::emit but takes Value for the arguments.
source§

fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R

Emit signal by its name. Read more
source§

fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>

Emit signal by its name. Read more
source§

fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by its name with details. Read more
source§

fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by its name with details. Read more
source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by signal id with details. Read more
source§

fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by signal id with details. Read more
source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
where F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
source§

fn notify(&self, property_name: &str)

Notify that the given property has changed its value. Read more
source§

fn notify_by_pspec(&self, pspec: &ParamSpec)

Notify that the given property has changed its value. Read more
source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
source§

fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + Send + 'static,

Add a callback to be notified when the Object is disposed.
source§

fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + 'static,

Add a callback to be notified when the Object is disposed. Read more
source§

fn bind_property<'a, 'f, 't, O>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str, ) -> BindingBuilder<'a, 'f, 't>
where O: ObjectType,

Bind property source_property on this object to the target_property on the target object. Read more
source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
source§

unsafe fn run_dispose(&self)

Runs the dispose mechanism of the object. Read more
source§

impl<O> OrientableExt for O
where O: IsA<Orientable>,

source§

fn orientation(&self) -> Orientation

source§

fn set_orientation(&self, orientation: Orientation)

source§

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

source§

impl<T> Property for T
where T: HasParamSpec,

source§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

source§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> TransparentType for T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

source§

impl<Super, Sub> MayDowncastTo<Sub> for Super
where Super: IsA<Super>, Sub: IsA<Super>,