[]Struct gtk::Tooltip

pub struct Tooltip(_, _);

Basic tooltips can be realized simply by using WidgetExt::set_tooltip_text or WidgetExt::set_tooltip_markup without any explicit tooltip object.

When you need a tooltip with a little more fancy contents, like adding an image, or you want the tooltip to have different contents per TreeView row or cell, you will have to do a little more work:

Return true from your query-tooltip handler. This causes the tooltip to be show. If you return false, it will not be shown.

In the probably rare case where you want to have even more control over the tooltip that is about to be shown, you can set your own Window which will be used as tooltip window. This works as follows:

Implements

glib::object::ObjectExt

Implementations

impl Tooltip[src]

pub fn set_custom<P: IsA<Widget>>(&self, custom_widget: Option<&P>)[src]

Replaces the widget packed into the tooltip with custom_widget. custom_widget does not get destroyed when the tooltip goes away. By default a box with a Image and Label is embedded in the tooltip, which can be configured using Tooltip::set_markup and Tooltip::set_icon.

custom_widget

a Widget, or None to unset the old custom widget.

pub fn set_icon(&self, pixbuf: Option<&Pixbuf>)[src]

Sets the icon of the tooltip (which is in front of the text) to be pixbuf. If pixbuf is None, the image will be hidden.

pixbuf

a gdk_pixbuf::Pixbuf, or None

pub fn set_icon_from_gicon<P: IsA<Icon>>(
    &self,
    gicon: Option<&P>,
    size: IconSize
)
[src]

Sets the icon of the tooltip (which is in front of the text) to be the icon indicated by gicon with the size indicated by size. If gicon is None, the image will be hidden.

gicon

a gio::Icon representing the icon, or None

size

a stock icon size (IconSize)

pub fn set_icon_from_icon_name(&self, icon_name: Option<&str>, size: IconSize)[src]

Sets the icon of the tooltip (which is in front of the text) to be the icon indicated by icon_name with the size indicated by size. If icon_name is None, the image will be hidden.

icon_name

an icon name, or None

size

a stock icon size (IconSize)

pub fn set_markup(&self, markup: Option<&str>)[src]

Sets the text of the tooltip to be markup, which is marked up with the [Pango text markup language][PangoMarkupFormat]. If markup is None, the label will be hidden.

markup

a markup string (see [Pango markup format][PangoMarkupFormat]) or None

pub fn set_text(&self, text: Option<&str>)[src]

Sets the text of the tooltip to be text. If text is None, the label will be hidden. See also Tooltip::set_markup.

text

a text string or None

pub fn set_tip_area(&self, rect: &Rectangle)[src]

Sets the area of the widget, where the contents of this tooltip apply, to be rect (in widget coordinates). This is especially useful for properly setting tooltips on TreeView rows and cells, GtkIconViews, etc.

For setting tooltips on TreeView, please refer to the convenience functions for this: TreeViewExt::set_tooltip_row and TreeViewExt::set_tooltip_cell.

rect

a gdk::Rectangle

pub fn trigger_tooltip_query(display: &Display)[src]

Triggers a new tooltip query on display, in order to update the current visible tooltip, or to show/hide the current tooltip. This function is useful to call when, for example, the state of the widget changed by a key press.

display

a gdk::Display

Trait Implementations

impl Clone for Tooltip

impl Debug for Tooltip

impl Display for Tooltip[src]

impl Eq for Tooltip

impl Hash for Tooltip

impl Ord for Tooltip

impl<T: ObjectType> PartialEq<T> for Tooltip

impl<T: ObjectType> PartialOrd<T> for Tooltip

impl StaticType for Tooltip

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.