[−][src]Struct native_windows_gui::Tooltip
Tooltips appear automatically, or pop up, when the user pauses the mouse pointer over a tool or some other UI element. The tooltip appears near the pointer and disappears when the user clicks a mouse button, moves the pointer away from the tool, or simply waits for a few seconds.
A tooltip can be applied to multiple controls, each with their own custom text.
This is done/undone using the register
/unregister
functions. So do not think
as Tooltip as a standalone toolip, but more like a manager.
Tooltip requires the tooltip
features
Example:
use native_windows_gui as nwg; fn add_tooltip(button: &nwg::Button, tooltips: &nwg::Tooltip) { tooltips.register(button, "This is a button!"); }
Fields
handle: ControlHandle
Implementations
impl Tooltip
[src]
pub fn builder<'a>() -> TooltipBuilder<'a>
[src]
pub fn text(&self, owner: &ControlHandle, buffer_size: Option<usize>) -> String
[src]
Return the current text of the tooltip. There is no way to know the size of the text so you have to pass the buffer size. The default buffer size is 200 characters.
pub fn set_text<'a>(&self, owner: &ControlHandle, text: &'a str)
[src]
Change the text of a previously registered control
Use the register
function is associate a control with this tooltip
pub fn set_decoration<'a>(&self, title: &'a str, ico: &Icon)
[src]
Set the icon and the title of a tooltip. This method use custom icon defined by user resources
pub fn set_default_decoration<'a>(&self, title: &'a str, icon: TooltipIcon)
[src]
Set the icon and the title of a tooltip. This method use built-in icon defined by TooltipIcon
pub fn hide(&self)
[src]
Hide the tooltip popup
pub fn count(&self) -> usize
[src]
Return the number of controls registered by the tooltip
pub fn set_delay_time(&self, delay: Option<u16>)
[src]
Set the delay time for the tooltip to spawn in milliseconds
Set the value to None
to reset the value to default
pub fn delay_time(&self) -> u16
[src]
Return the delay time of the tooltip in milliseconds
pub fn set_enabled(&self, v: bool)
[src]
Enable or disable the control Windows does not support reading the enabled state of a tooltip btw.
pub fn register<'a, W: Into<ControlHandle>>(&self, owner: W, text: &'a str)
[src]
Register the tooltip under a control.
owner
must be a window control.
pub fn register_callback<W: Into<ControlHandle>>(&self, owner: W)
[src]
Register the tooltip under a control.
owner
must be a window control.
When the user trigger the tooltip, the application receives a OnTooltipText
event
pub fn unregister<W: Into<ControlHandle>>(&self, owner: W)
[src]
Remove the tooltip from a control
pub fn class_name(&self) -> &'static str
[src]
Winapi class name used during control creation
pub fn flags(&self) -> u32
[src]
Winapi base flags used during window creation
pub fn forced_flags(&self) -> u32
[src]
Winapi flags required by the control
Trait Implementations
impl Default for Tooltip
[src]
impl Drop for Tooltip
[src]
impl Eq for Tooltip
[src]
impl<'_> From<&'_ Tooltip> for ControlHandle
[src]
impl PartialEq<ControlHandle> for Tooltip
[src]
fn eq(&self, other: &ControlHandle) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Tooltip> for Tooltip
[src]
impl PartialEq<Tooltip> for ControlHandle
[src]
impl StructuralEq for Tooltip
[src]
impl StructuralPartialEq for Tooltip
[src]
Auto Trait Implementations
impl RefUnwindSafe for Tooltip
impl !Send for Tooltip
impl !Sync for Tooltip
impl Unpin for Tooltip
impl UnwindSafe for Tooltip
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,