Struct rstk::label::TkLabel

source ·
pub struct TkLabel {
    pub id: String,
}
Expand description

Refers to a label widget

Fields§

§id: String

Implementations§

source§

impl TkLabel

source

pub fn anchor(&self, value: Anchor)

Position of information with respect to internal margins.

e.g. the space allocated to the label can be larger than its text needs, so an Anchor value of E (east) will display the text against the right-margin.

source

pub fn background(&self, colour: &str)

Specifies the background colour.

Colours are specified as a string, by either:

  • name - using one of the values in the tk colours list
  • rgb - as a 6-digit hexadecimal value in form “#RRGGBB”
source

pub fn justify(&self, value: Justify)

Alignment of text within widget.

source

pub fn relief(&self, value: Relief)

Style of border around label.

source

pub fn wrap_length(&self, length: u64)

Sets the maximum line length, in pixels. When set, displayed text is separated into lines, not exceeding the given length.

Trait Implementations§

source§

impl Clone for TkLabel

source§

fn clone(&self) -> TkLabel

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for TkLabel

source§

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

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

impl PartialEq for TkLabel

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl TkGridLayout for TkLabel

source§

fn grid(&self) -> GridLayout

Creates a GridLayout instance for placing this widget within its parent.
source§

fn grid_configure(&self, option: &str, value: &str)

Sets properties for widget layout directly through Tk: see Tk manual for options. Read more
source§

fn grid_forget(&self)

Removes this widget from layout.
source§

impl TkLabelOptions for TkLabel

source§

fn compound(&self, value: Compound)

Sets how to arrange the image relative to the text.
source§

fn font(&self, definition: &TkFont)

Sets the font to use for text.
source§

fn foreground(&self, colour: &str)

Sets the foreground (text) colour.
source§

fn image(&self, image: &TkImage)

Sets an image to display on the widget.
source§

fn padding(&self, values: &[u64])

Sets space around the widget. Takes an array of up to four values, specifying the number of pixels on the different sides: Read more
source§

fn text(&self, value: &str)

Sets the text label for the widget.
source§

fn underline(&self, index: u64)

Underlines the character at the given index position.
source§

fn width(&self, value: i64)

Sets the width of the widget, in characters
source§

impl TkPackLayout for TkLabel

source§

fn pack(&self) -> PackLayout

Creates a PackLayout instance for placing this widget within its parent
source§

fn pack_configure(&self, option: &str, value: &str)

Sets properties for widget layout
source§

fn pack_forget(&self)

Removes this widget from layout
source§

impl TkWidget for TkLabel

source§

fn id(&self) -> &str

Returns the widget’s id reference - used within tk

source§

fn bind(&self, pattern: &str, command: impl Fn(TkEvent) + Send + 'static)

Binds a command to this widget to call on given event pattern
source§

fn cget(&self, option: &str) -> String

Retrieve the value of a configuration option as a string. Read more
source§

fn configure(&self, option: &str, value: &str)

Used to change properties of a widget. This function can be used to directly configure the widget using an option-value string pair: Read more
source§

fn destroy(&self)

Destroys a widget and its children.
source§

fn winfo(&self, option: &str) -> String

winfo retrieves information about widget.
source§

fn focus(&self)

Makes this widget the focus window (e.g. for key presses)
source§

fn position_x(&self) -> u64

Returns the widget x position in pixels, within its parent.
source§

fn position_y(&self) -> u64

Returns the widget y position in pixels, within its parent.
source§

fn widget_height(&self) -> u64

Returns the widget height in pixels.
source§

fn widget_width(&self) -> u64

Returns the widget width in pixels.
source§

fn mouse_position(&self) -> (i64, i64)

Returns the position of the mouse on screen of widget as (x,y).
source§

fn mouse_x(&self) -> i64

Gives the x position of the mouse on screen of widget.
source§

fn mouse_y(&self) -> i64

Gives the y position of the mouse on screen of widget.
source§

fn screen_height(&self) -> u64

Height of screen of widget in pixels.
source§

fn screen_height_mm(&self) -> u64

Height of screen of widget in millimetres.
source§

fn screen_width(&self) -> u64

Width of screen of widget in pixels.
source§

fn screen_width_mm(&self) -> u64

Width of screen of widget in millimetres.
source§

fn lower(&self)

Lowers the widget in stacking order.
source§

fn raise(&self)

Raises the widget in stacking order.
source§

fn grid_configure_column(&self, index: u64, option: &str, value: &str)

Sets property for a given column of the grid layout contained within this widget.
source§

fn grid_configure_row(&self, index: u64, option: &str, value: &str)

Sets property for a given row of the grid layout contained within this widget.
source§

impl StructuralPartialEq for TkLabel

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.