[][src]Trait kas::TkWidget

pub trait TkWidget {
    fn size_hints(&self, tkd: TkData) -> (Coord, Coord);
fn get_rect(&self, tkd: TkData) -> Rect;
fn set_rect(&self, tkd: TkData, rect: &Rect);
fn set_label(&self, tkd: TkData, text: &str); }

Common widget properties. Implemented by the toolkit.

Users interact with this trait in a few cases, such as implementing widget event handling. In these cases the user is always given an existing reference to a TkWidget. Mostly this trait is only used internally.

Note that it is not necessary for toolkits to implement all of these methods, depending on which functionality from the library is used.

Required methods

fn size_hints(&self, tkd: TkData) -> (Coord, Coord)

Get the widget's minimum and preferred sizes.

fn get_rect(&self, tkd: TkData) -> Rect

Get the widget's position and size.

fn set_rect(&self, tkd: TkData, rect: &Rect)

Set the widget's position and size.

Does not need to update child widgets.

fn set_label(&self, tkd: TkData, text: &str)

Set the widget's label (where applicable)

Loading content...

Implementors

Loading content...