Class: Gtk::StatusIcon

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#embedded=(embedded) ⇒ TrueClass

true if the statusicon is embedded in a notification area.

Parameters:

  • embedded (TrueClass)

Returns:

  • (TrueClass)

    embedded

  • (TrueClass)

    embedded

#embedded?TrueClass

true if the statusicon is embedded in a notification area.

Returns:

  • (TrueClass)

    embedded

#file=(file) ⇒ String

Returns file.

Parameters:

  • file (String)

Returns:

  • (String)

    file

#from_file=(filename) ⇒ nil

Makes status_icon display the file filename. See gtk_status_icon_new_from_file() for details.

Parameters:

  • filename (Gtk::filename)

    a filename

Returns:

  • (nil)

#from_gicon=(icon) ⇒ nil

Makes status_icon display the #GIcon. See gtk_status_icon_new_from_gicon() for details.

Parameters:

Returns:

  • (nil)

#from_icon_name=(icon_name) ⇒ nil

Makes status_icon display the icon named icon_name from the current icon theme. See gtk_status_icon_new_from_icon_name() for details.

Parameters:

  • icon_name (String)

    an icon name

Returns:

  • (nil)

#from_pixbuf=(pixbuf) ⇒ nil

Makes status_icon display pixbuf. See gtk_status_icon_new_from_pixbuf() for details.

Parameters:

Returns:

  • (nil)

#from_stock=(stock_id) ⇒ nil

Makes status_icon display the stock icon with the id stock_id. See gtk_status_icon_new_from_stock() for details.

Parameters:

  • stock_id (String)

    a stock icon id

Returns:

  • (nil)

#get_geometry(screen, area, orientation) ⇒ TrueClass

Obtains information about the location of the status icon on screen. This information can be used to e.g. position popups like notification bubbles.

See gtk_status_icon_position_menu() for a more convenient alternative for positioning menus.

Note that some platforms do not allow GTK+ to provide this information, and even on platforms that do allow it, the information is not reliable unless the status icon is embedded in a notification area, see gtk_status_icon_is_embedded().

Parameters:

  • screen (Gdk::Screen)

    return location for the screen, or nil if the information is not needed

  • area (Gdk::Rectangle)

    return location for the area occupied by the status icon, or nil

  • orientation (Gtk::Orientation)

    return location for the orientation of the panel in which the status icon is embedded, or nil. A panel at the top or bottom of the screen is horizontal, a panel at the left or right is vertical.

Returns:

  • (TrueClass)

    true if the location information has been filled in

#giconGio::Icon

The #GIcon displayed in the Gtk::StatusIcon. For themed icons, the image will be updated automatically if the theme changes.

Returns:

#gicon=(gicon) ⇒ Gio::Icon

The #GIcon displayed in the Gtk::StatusIcon. For themed icons, the image will be updated automatically if the theme changes.

Parameters:

Returns:

#has_tooltipTrueClass

Returns the current value of the has-tooltip property. See Gtk::StatusIcon:has-tooltip for more information.

Returns:

  • (TrueClass)

    current value of has-tooltip on status_icon.

#has_tooltip=(has_tooltip) ⇒ TrueClass

Enables or disables the emission of Gtk::StatusIcon::query-tooltip on status_icon. A value of true indicates that status_icon can have a tooltip, in this case the status icon will be queried using Gtk::StatusIcon::query-tooltip to determine whether it will provide a tooltip or not.

Note that setting this property to true for the first time will change the event masks of the windows of this status icon to include leave-notify and motion-notify events. This will not be undone when the property is set to false again.

Whether this property is respected is platform dependent. For plain text tooltips, use Gtk::StatusIcon:tooltip-text in preference.

Parameters:

  • has_tooltip (TrueClass)

Returns:

  • (TrueClass)

    has-tooltip

  • (TrueClass)

    has-tooltip

#has_tooltip?TrueClass

Enables or disables the emission of Gtk::StatusIcon::query-tooltip on status_icon. A value of true indicates that status_icon can have a tooltip, in this case the status icon will be queried using Gtk::StatusIcon::query-tooltip to determine whether it will provide a tooltip or not.

Note that setting this property to true for the first time will change the event masks of the windows of this status icon to include leave-notify and motion-notify events. This will not be undone when the property is set to false again.

Whether this property is respected is platform dependent. For plain text tooltips, use Gtk::StatusIcon:tooltip-text in preference.

Returns:

  • (TrueClass)

    has-tooltip

#icon_nameString

Returns icon-name.

Returns:

  • (String)

    icon-name

#icon_name=(icon_name) ⇒ String

Parameters:

  • icon_name (String)

Returns:

  • (String)

    icon-name

  • (String)

    icon-name

#is_embeddedTrueClass

Returns whether the status icon is embedded in a notification area.

Returns:

  • (TrueClass)

    true if the status icon is embedded in a notification area.

#name=(name) ⇒ nil

Sets the name of this tray icon. This should be a string identifying this icon. It is may be used for sorting the icons in the tray and will not be shown to the user.

Parameters:

  • name (String)

    the name

Returns:

  • (nil)

#newGtk::StatusIcon

Creates an empty status icon object.

Returns:

#new_from_file(filename) ⇒ Gtk::StatusIcon

Creates a status icon displaying the file filename.

The image will be scaled down to fit in the available space in the notification area, if necessary.

Parameters:

  • filename (Gtk::filename)

    a filename

Returns:

#new_from_gicon(icon) ⇒ Gtk::StatusIcon

Creates a status icon displaying a #GIcon. If the icon is a themed icon, it will be updated when the theme changes.

Parameters:

Returns:

#new_from_icon_name(icon_name) ⇒ Gtk::StatusIcon

Creates a status icon displaying an icon from the current icon theme. If the current icon theme is changed, the icon will be updated appropriately.

Parameters:

  • icon_name (String)

    an icon name

Returns:

#new_from_pixbuf(pixbuf) ⇒ Gtk::StatusIcon

Creates a status icon displaying pixbuf.

The image will be scaled down to fit in the available space in the notification area, if necessary.

Parameters:

Returns:

#new_from_stock(stock_id) ⇒ Gtk::StatusIcon

Creates a status icon displaying a stock icon. Sample stock icon names are #GTK_STOCK_OPEN, #GTK_STOCK_QUIT. You can register your own stock icon names, see gtk_icon_factory_add_default() and gtk_icon_factory_add().

Parameters:

  • stock_id (String)

    a stock icon id

Returns:

#orientationGtk::Orientation

The orientation of the tray in which the statusicon is embedded.

Returns:

#orientation=(orientation) ⇒ Gtk::Orientation

The orientation of the tray in which the statusicon is embedded.

Parameters:

Returns:

#pixbufGdkPixbuf::Pixbuf

Returns pixbuf.

Returns:

#pixbuf=(pixbuf) ⇒ GdkPixbuf::Pixbuf

Parameters:

Returns:

#screenGdk::Screen

Returns screen.

Returns:

#screen=(screen) ⇒ Gdk::Screen

Parameters:

Returns:

#sizeInteger

Returns size.

Returns:

  • (Integer)

    size

#size=(size) ⇒ Integer

Parameters:

  • size (Integer)

Returns:

  • (Integer)

    size

  • (Integer)

    size

#stockString

Returns stock.

Returns:

  • (String)

    stock

#stock=(stock) ⇒ String

Parameters:

  • stock (String)

Returns:

  • (String)

    stock

  • (String)

    stock

#storage_typeGtk::ImageType

Returns storage-type.

Returns:

#storage_type=(storage_type) ⇒ Gtk::ImageType

Parameters:

Returns:

#titleString

The title of this tray icon. This should be a short, human-readable, localized string describing the tray icon. It may be used by tools like screen readers to render the tray icon.

Returns:

  • (String)

    title

#title=(title) ⇒ String

The title of this tray icon. This should be a short, human-readable, localized string describing the tray icon. It may be used by tools like screen readers to render the tray icon.

Parameters:

  • title (String)

Returns:

  • (String)

    title

  • (String)

    title

#tooltip_markupString

Sets the text of tooltip to be the given string, which is marked up with the [Pango text markup language]. Also see gtk_tooltip_set_markup().

This is a convenience property which will take care of getting the tooltip shown if the given string is not nil. Gtk::StatusIcon:has-tooltip will automatically be set to true and the default handler for the Gtk::StatusIcon::query-tooltip signal will take care of displaying the tooltip.

On some platforms, embedded markup will be ignored.

Returns:

  • (String)

    tooltip-markup

#tooltip_markup=(tooltip_markup) ⇒ String

Sets the text of tooltip to be the given string, which is marked up with the [Pango text markup language]. Also see gtk_tooltip_set_markup().

This is a convenience property which will take care of getting the tooltip shown if the given string is not nil. Gtk::StatusIcon:has-tooltip will automatically be set to true and the default handler for the Gtk::StatusIcon::query-tooltip signal will take care of displaying the tooltip.

On some platforms, embedded markup will be ignored.

Parameters:

  • tooltip_markup (String)

Returns:

  • (String)

    tooltip-markup

  • (String)

    tooltip-markup

#tooltip_textString

Sets the text of tooltip to be the given string.

Also see gtk_tooltip_set_text().

This is a convenience property which will take care of getting the tooltip shown if the given string is not nil. Gtk::StatusIcon:has-tooltip will automatically be set to true and the default handler for the Gtk::StatusIcon::query-tooltip signal will take care of displaying the tooltip.

Note that some platforms have limitations on the length of tooltips that they allow on status icons, e.g. Windows only shows the first 64 characters.

Returns:

  • (String)

    tooltip-text

#tooltip_text=(tooltip_text) ⇒ String

Sets the text of tooltip to be the given string.

Also see gtk_tooltip_set_text().

This is a convenience property which will take care of getting the tooltip shown if the given string is not nil. Gtk::StatusIcon:has-tooltip will automatically be set to true and the default handler for the Gtk::StatusIcon::query-tooltip signal will take care of displaying the tooltip.

Note that some platforms have limitations on the length of tooltips that they allow on status icons, e.g. Windows only shows the first 64 characters.

Parameters:

  • tooltip_text (String)

Returns:

  • (String)

    tooltip-text

  • (String)

    tooltip-text

#visibleTrueClass

Returns whether the status icon is visible or not. Note that being visible does not guarantee that the user can actually see the icon, see also gtk_status_icon_is_embedded().

Returns:

  • (TrueClass)

    true if the status icon is visible

#visible=(visible) ⇒ TrueClass

Parameters:

  • visible (TrueClass)

Returns:

  • (TrueClass)

    visible

  • (TrueClass)

    visible

#visible?TrueClass

Returns visible.

Returns:

  • (TrueClass)

    visible

#x11_window_idInteger

This function is only useful on the X11/freedesktop.org platform.

It returns a window ID for the widget in the underlying status icon implementation. This is useful for the Galago notification service, which can send a window ID in the protocol in order for the server to position notification windows pointing to a status icon reliably.

This function is not intended for other use cases which are more likely to be met by one of the non-X11 specific methods, such as gtk_status_icon_position_menu(). underlying X11 Window

Returns:

  • (Integer)

    An 32 bit unsigned integer identifier for the