pub struct MacWidget(WidgetKind);Tuple Fields§
§0: WidgetKindImplementations§
Source§impl MacWidget
impl MacWidget
pub(crate) fn label( mtm: MainThreadMarker, text: &str, style: LabelStyle, ) -> Self
A button made with a selection is an on-off button, shown on while selected.
pub(crate) fn text_field( mtm: MainThreadMarker, text: &str, placeholder: &str, on_change: TextHandler, on_submit: Option<ClickHandler>, ) -> Self
Sourcepub(crate) fn text_area(
mtm: MainThreadMarker,
text: &str,
lines: u32,
on_change: TextHandler,
) -> Self
pub(crate) fn text_area( mtm: MainThreadMarker, text: &str, lines: u32, on_change: TextHandler, ) -> Self
Plain text over lines lines, which wraps and scrolls; Return starts a new line.
pub(crate) fn checkbox( mtm: MainThreadMarker, title: &str, checked: bool, on_toggle: ToggleHandler, ) -> Self
Sourcepub(crate) fn progress(mtm: MainThreadMarker, percent: Option<i64>) -> Self
pub(crate) fn progress(mtm: MainThreadMarker, percent: Option<i64>) -> Self
A bar filled to percent, or an animated one while work goes on without one.
pub(crate) fn switch( mtm: MainThreadMarker, title: &str, on: bool, on_toggle: ToggleHandler, ) -> Self
Sourcepub(crate) fn slider(
mtm: MainThreadMarker,
value: i64,
min: i64,
max: i64,
on_change: NumberHandler,
) -> Self
pub(crate) fn slider( mtm: MainThreadMarker, value: i64, min: i64, max: i64, on_change: NumberHandler, ) -> Self
Slides smoothly, reporting the whole number nearest the knob as it changes.
pub(crate) fn picker( mtm: MainThreadMarker, options: &[String], selected: &str, on_pick: TextHandler, ) -> Self
Sourcepub(crate) fn image(
mtm: MainThreadMarker,
path: Option<&Path>,
size: ImageSize,
) -> Self
pub(crate) fn image( mtm: MainThreadMarker, path: Option<&Path>, size: ImageSize, ) -> Self
An image view that scales its image to fit, keeping its shape, and centres it.
Sourcepub(crate) fn set_image(&self, path: Option<&Path>)
pub(crate) fn set_image(&self, path: Option<&Path>)
Shows the image in the file at path, or nothing when there is none or it can’t be
read.
pub(crate) fn divider(mtm: MainThreadMarker) -> Self
pub(crate) fn drop_target(mtm: MainThreadMarker, on_drop: DropHandler) -> Self
pub(crate) fn surface(mtm: MainThreadMarker, surface: Surface) -> Self
Sourcepub(crate) fn scroll(mtm: MainThreadMarker) -> Self
pub(crate) fn scroll(mtm: MainThreadMarker) -> Self
A borderless area that scrolls its content up and down, on whatever is behind it. Where scroll bars take space, the bar always shows, in the strip kept for it.
Sourcepub(crate) fn scroll_bar_width(mtm: MainThreadMarker) -> f32
pub(crate) fn scroll_bar_width(mtm: MainThreadMarker) -> f32
The width a scroll bar takes from the content beside it; overlay scroll bars, the default with a trackpad, take none.
Sourcepub(crate) fn content_view(&self) -> &NSView
pub(crate) fn content_view(&self) -> &NSView
The view a scroll area’s content goes in.
§Panics
When this isn’t a scroll area, which only a runtime bug would ask.
pub(crate) fn set_scroll_content(&self, size: Size)
pub(crate) fn view(&self) -> &NSView
pub(crate) fn set_text(&self, text: &str)
pub(crate) fn set_checked(&self, checked: bool)
pub(crate) fn set_badge(&self, badge: &str)
pub(crate) fn set_value(&self, value: i64)
Sourcepub(crate) fn set_options(&self, options: &[String])
pub(crate) fn set_options(&self, options: &[String])
Replaces a picker’s items, keeping the one it shows if it is still there. Items are added through the menu, which keeps any with the same title.