Skip to main content

WidgetKind

Enum WidgetKind 

Source
enum WidgetKind {
Show 16 variants Label(Retained<NSTextField>), Button { button: Retained<NSButton>, target: Retained<ClickTarget>, icon_only: bool, }, TextField { field: Retained<NSTextField>, delegate: Retained<TextFieldDelegate>, }, TextArea { scroll: Retained<NSScrollView>, text_view: Retained<NSTextView>, delegate: Retained<TextViewDelegate>, lines: u32, }, Checkbox { checkbox: Retained<NSButton>, target: Retained<ToggleTarget>, }, Switch(SwitchRow), Slider { slider: Retained<NSSlider>, target: Retained<NumberTarget>, }, Picker { popup: Retained<NSPopUpButton>, target: Retained<PickTarget>, }, NavItem(NavItem), Progress(Retained<NSProgressIndicator>), Image { view: Retained<NSImageView>, size: ImageSize, }, Divider(Retained<NSBox>), ContextMenu(Retained<MenuArea>), DropTarget(Retained<DropArea>), Surface(Retained<NSView>), Scroll { view: Retained<NSScrollView>, content: Retained<FlippedView>, },
}
Expand description

AppKit holds targets and delegates weakly, so each widget owns its own.

Variants§

§

Label(Retained<NSTextField>)

§

Button

Fields

§icon_only: bool

Shows only its icon, so its title is the tooltip.

§

TextField

§

TextArea

A text field several lines tall: a text view in a scroll view with a border.

§

Checkbox

Fields

§checkbox: Retained<NSButton>
§

Switch(SwitchRow)

§

Slider

§

Picker

§

NavItem(NavItem)

§

Progress(Retained<NSProgressIndicator>)

§

Image

§

Divider(Retained<NSBox>)

§

ContextMenu(Retained<MenuArea>)

The hidden area a stack’s context menu covers.

§

DropTarget(Retained<DropArea>)

The hidden area a stack’s drop target covers.

§

Surface(Retained<NSView>)

§

Scroll

Its content is a flipped view, so content starts at the top as Nifty lays it out.

Trait Implementations§

Source§

impl Debug for WidgetKind

Source§

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

Formats the value using the given formatter. Read more

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> AutoreleaseSafe for T
where T: ?Sized,

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, 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, 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.