gtk.IconInfoobject containing
information about and icon in an icon theme (new in PyGTK 2.4)Synopsisgtk.IconInfogobject.GBoxedcopyfreeget_base_sizeget_filenameget_builtin_pixbufload_iconset_raw_coordinatesraw_coordinatesget_embedded_rectget_attach_pointsget_display_nameFunctionsgtk.icon_info_new_from_pixbufpixbufDescriptionThis object is available in PyGTK 2.4 and above.A gtk.IconInfo
object contains information about an icon in a gtk.IconTheme. A
gtk.IconInfo
object is created using the gtk.IconTheme.lookup_icon()
method.A gtk.gdk.Pixbuf can
be rendered with the icon using the load_icon()
method. If you just want to load the pixbuf of an icon you can use the gtk.IconTheme.load_icon()
method that combines the gtk.IconTheme.lookup_icon()
method and the load_icon()
method.Methodsgtk.IconInfo.copycopyReturns :the new gtk.IconInfoThis method is available in PyGTK 2.4 and above.The copy() method returns a copy of the
icon info object.gtk.IconInfo.freefreeThis method is available in PyGTK 2.4 and above.This method is deprecated and should not be used since it can
crash your application.The free() method frees the icon info
and its associated informationgtk.IconInfo.get_base_sizeget_base_sizeReturns :the base size, or 0, if no base
size is known for the icon.This method is available in PyGTK 2.4 and above.The get_base_size() method returns the
base size for the icon. The base size is a size for the icon that was
specified by the icon theme creator. This may be different than the actual
size of image; an example of this is small emblem icons that can be attached
to a larger icon. These icons will be given the same base size as the larger
icons to which they are attached.gtk.IconInfo.get_filenameget_filenameReturns :the filename for the icon, or
None if the get_builtin_pixbuf()
should be used instead.This method is available in PyGTK 2.4 and above.The get_filename() method returns the filename for the icon. If
the gtk.ICON_LOOKUP_USE_BUILTIN flag was passed to the
gtk.IconTheme.lookup_icon()
method, there may be no filename if a builtin icon is returned. In this
case, you should use the get_builtin_pixbuf()
method.gtk.IconInfo.get_builtin_pixbufget_builtin_pixbufReturns :the built-in image pixbuf, or
None.This method is available in PyGTK 2.4 and above.The get_builtin_pixbuf() method returns
the built-in image for this icon, if any. To allow GTK+
to use built in icon images, you must pass the
gtk.ICON_LOOKUP_USE_BUILTIN to the gtk.IconTheme.lookup_icon()
method.gtk.IconInfo.load_iconload_iconReturns :the icon rendered into a gtk.gdk.Pixbuf.
This may be a newly created icon or a new reference to an internal
icon, so you must not modify the icon.This method is available in PyGTK 2.4 and above.The load_icon() method renders the icon
previously looked up in an icon theme using the gtk.IconTheme.lookup_icon()
method. The icon size will be based on the size passed to the gtk.IconTheme.lookup_icon()
method. Note that the resulting gtk.gdk.Pixbuf may
not be exactly this size. An icon theme may have icons that differ slightly
from their nominal sizes, and in addition GTK+ will avoid
scaling icons that it considers sufficiently close to the requested size to
maintain sharpness.This method raise the GError exception if an error occurs during
rendering of the icon.gtk.IconInfo.set_raw_coordinatesset_raw_coordinatesraw_coordinatesraw_coordinates :if True, the coordinates of
embedded rectangles and attached points should be returned in
their original (unscaled) form.This method is available in PyGTK 2.4 and above.The set_raw_coordinates() method sets
the internal raw_coordinates flag to the value of
raw_coordinates. If
raw_coordinates is True, the
coordinates returned by the get_embedded_rect()
and get_attach_points()
methods will be returned in their original form as specified in the icon
theme, instead of scaled appropriately for the pixbuf returned by the load_icon()
method.Raw coordinates are somewhat strange; they are specified to be
with respect to the unscaled pixmap for PNG and
XPM icons, but for SVG icons, they are
in a 1000x1000 coordinate space that is scaled to the final size of the
icon. You can determine if the icon is an SVG icon by
using the get_filename()
method, and seeing if it is not None and ends in '.svg'.This method is provided primarily to allow compatibility
wrappers for older API's, and is not expected to be useful for
applications.gtk.IconInfo.get_embedded_rectget_embedded_rectReturns :a gtk.gdk.Rectangle
or NoneThis method is available in PyGTK 2.4 and above.The get_embedded_rect() method returns
a gtk.gdk.Rectangle
containing the coordinates of a rectangle within the icon that can be used
for display of information such as a preview of the contents of a text file.
See the set_raw_coordinates()
method for further information about the coordinate system.gtk.IconInfo.get_attach_pointsget_attach_pointsReturns :a tuple containing a set of 2-tuples for the
attach pointsThis method is available in PyGTK 2.4 and above.The get_attach_points() method returns
a tuple containing the attach points for an icon as a set of 2-tuples. An
attach point is a location in the icon that can be used as anchor points for
attaching emblems or overlays to the icon.gtk.IconInfo.get_display_nameget_display_nameReturns :the display name for the icon or None, if
the icon doesn't have a specified display name.This method is available in PyGTK 2.4 and above.The get_display_name() method returns the display name for an icon. A display name is a
string to be used in place of the icon name in a user
visible context like a list of icons.Functionsgtk.icon_info_new_from_pixbufgtk.icon_info_new_from_pixbufpixbufpixbuf :the gtk.Pixbuf
to wrap in a gtk.IconInfo.
This function is available in PyGTK 2.14 and above.
Creates a gtk.IconInfo
for a gtk.Pixbuf.