pub struct Label<T: FormattableText + 'static> { /* private fields */ }
Expand description

A text label

A text label. Vertical alignment defaults to centred, horizontal alignment depends on the script direction if not specified. Line-wrapping is enabled by default.

This type is generic over the text type. See also: StrLabel, StringLabel, AccelLabel.

Implementations

Construct from label

Get text class

Set text class

Default: TextClass::Label(true)

Set text class (inline)

Default: TextClass::Label(true)

Get whether line-wrapping is enabled

Enable/disable line wrapping

This is equivalent to label.set_class(TextClass::Label(wrap)).

By default this is enabled.

Enable/disable line wrapping (inline)

Get read access to the text object

Set text in an existing Label

Note: this must not be called before fonts have been initialised (usually done by the theme when the main loop starts).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Converts to this type from the input type.

Converts to this type from the input type.

Get text by reference

Get text as a String

Set text from a string

Set text from a &str Read more

Draw a widget and its children Read more

Get size rules for the given axis Read more

Set size and position Read more

Translate a coordinate to a WidgetId Read more

Get size rules for the given axis Read more

Set size and position Read more

Draw a widget and its children Read more

Translate a coordinate to a WidgetId Read more

Pre-configuration Read more

Configure widget Read more

Is this widget navigable via Tab key? Read more

Get translation of children relative to this widget Read more

Navigation in spatial order Read more

Handle an event sent to this widget Read more

Potentially steal an event before it reaches a child Read more

Handle an event sent to child index but left unhandled Read more

Handler for messages from children/descendants Read more

Handler for scrolling Read more

Get the number of child widgets Read more

Get a reference to a child widget by index, or None if the index is out of bounds. Read more

Mutable variant of get Read more

Find the child which is an ancestor of this id, if any Read more

Make an identifier for a child Read more

Get the widget’s identifier Read more

Get the widget’s region, relative to its parent.

Get the name of the widget struct

Erase type

Erase type

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast from Self to T Read more

Try converting from Self to T Read more

Try approximate conversion from Self to T Read more

Cast approximately from Self to T Read more

Cast to integer, truncating Read more

Cast to the nearest integer Read more

Cast the floor to an integer Read more

Cast the ceiling to an integer Read more

Try converting to integer with truncation Read more

Try converting to the nearest integer Read more

Try converting the floor to an integer Read more

Try convert the ceiling to an integer Read more

Converts to this type from the input type.

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Get the widget’s identifier Read more

Test widget identifier for equality Read more

Display as “StructName#WidgetId”

Check whether id is self or a descendant Read more

Check whether id is not self and is a descendant Read more

Find the descendant with this id, if any

Find the descendant with this id, if any