pub struct ToolbarItem {
pub identifier: String,
pub objc: Id<Object>,
pub button: Option<Button>,
pub image: Option<Image>,
/* private fields */
}
Available on crate feature
appkit
only.Expand description
Wraps NSToolbarItem
. Enables configuring things like size, view, and so on.
Fields
identifier: String
objc: Id<Object>
image: Option<Image>
Implementations
sourceimpl ToolbarItem
impl ToolbarItem
sourcepub fn new<S: Into<String>>(identifier: S) -> Self
pub fn new<S: Into<String>>(identifier: S) -> Self
Creates and returns a new ToolbarItem
, ensuring the underlying NSToolbarItem
is
properly initialized.
Sets and takes ownership of the button for this item.
sourcepub fn set_image(&mut self, image: Image)
pub fn set_image(&mut self, image: Image)
Sets and takes ownership of the image for this toolbar item.
sourcepub fn set_min_size(&mut self, width: f64, height: f64)
pub fn set_min_size(&mut self, width: f64, height: f64)
Sets the minimum size for this button.
sourcepub fn set_max_size(&mut self, width: f64, height: f64)
pub fn set_max_size(&mut self, width: f64, height: f64)
Sets the maximum size for this button.
sourcepub fn set_action<F: Fn() + Send + Sync + 'static>(&mut self, action: F)
pub fn set_action<F: Fn() + Send + Sync + 'static>(&mut self, action: F)
Sets an action on this item.
pub fn set_bordered(&self, bordered: bool)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ToolbarItem
impl !Send for ToolbarItem
impl !Sync for ToolbarItem
impl Unpin for ToolbarItem
impl !UnwindSafe for ToolbarItem
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more