gtk.IconInfo — object containing information about and icon in an icon theme (new in PyGTK 2.4)
class gtk.IconInfo(gobject.GBoxed): |
This 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.
|
Returns : | the new gtk.IconInfo |
This method is available in PyGTK 2.4 and above.
The copy() method returns a copy of the icon info object.
|
This 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 information
|
Returns : | 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.
|
Returns : | 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.
|
Returns : | 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.
|
Returns : | 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.
|
raw_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.
|
Returns : | a gtk.gdk.Rectangle or None |
This 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.
|
Returns : | a tuple containing a set of 2-tuples for the attach points |
This 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.
|
Returns : | 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.