#[repr(C)]pub struct ncselector { /* private fields */ }
Implementations§
Source§impl ncselector
impl ncselector
Sourcepub fn new<'a>(
plane: &mut NcPlane,
options: &NcSelectorOptions,
) -> NcResult<&'a mut Self>
pub fn new<'a>( plane: &mut NcPlane, options: &NcSelectorOptions, ) -> NcResult<&'a mut Self>
Creates a selector over a plane
.
The selector will take care of destroying the plane.
Sourcepub fn builder() -> NcSelectorBuilder
pub fn builder() -> NcSelectorBuilder
Starts the builder.
Sourcepub fn offer_input(&mut self, input: impl Into<NcInput>) -> bool
pub fn offer_input(&mut self, input: impl Into<NcInput>) -> bool
Offers an input to the selector.
If it’s relevant, this function returns true, and the input ought not be processed further. If it’s irrelevant to the selector, false is returned.
Relevant inputs include:
- a mouse click on an item.
- a mouse scrollwheel event.
- a mouse click on the scrolling arrows.
- up, down, pgup, or pgdown on an unrolled menu (navigates among items).
Sourcepub fn destroy(&mut self) -> NcResult<()>
pub fn destroy(&mut self) -> NcResult<()>
Destroys the NcSelector
.
Note that this also destroys the NcPlane
.
Sourcepub fn additem(&mut self, item: NcSelectorItem) -> NcResult<i32>
pub fn additem(&mut self, item: NcSelectorItem) -> NcResult<i32>
Adds an item.
Sourcepub fn delitem(&mut self, item: &str) -> NcResult<i32>
pub fn delitem(&mut self, item: &str) -> NcResult<i32>
Deletes an item.
C style function: ncselector_delitem().
Sourcepub fn selected(&mut self) -> Option<String>
pub fn selected(&mut self) -> Option<String>
Returns the selected option if there is one.
C style function: ncselector_delitem().
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ncselector
impl RefUnwindSafe for ncselector
impl Send for ncselector
impl Sync for ncselector
impl Unpin for ncselector
impl UnwindSafe for ncselector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more