gio.LoadableIcon
Prev | PyGio Class Reference | Next

## gio.LoadableIcon

gio.LoadableIcon — Interface for icons.

## Synopsis

    class gio.LoadableIcon(gobject.GInterface):
        def load(size=0, cancellable=None)
        def load_async(callback, size=0, cancellable=None, user_data=None)
        def load_finish(res)

## Ancestry

    +-- gobject.GInterface
      +-- gio.LoadableIcon

## Prerequisites

`gio.LoadableIcon` requires `gio.Icon`. and `gobject.GObject`

## Known Implementation

`gio.LoadableIcon` is implemented by `gio.FileIcon`

## Description

`gio.LoadableIcon` extends the `gio.Icon` interface and adds the ability to load icons from streams.

## Methods

### gio.LoadableIcon.load

        def load(size=0, cancellable=None)

`size` : | an integer
`cancellable` : | optional `gio.Cancellable` object, `None` to ignore.
Returns : | a 2 tuple containing a `gio.InputStream` to read the icon from and a string containing the icon type.

The `load`() method loads a loadable icon. For the asynchronous version of this function, see `gio.LoadableIcon.load_async`().

### gio.LoadableIcon.load_async

        def load_async(callback, size=0, cancellable=None, user_data=None)

`callback` : | a GAsyncReadyCallback to call when the request is satisfied.
`size` : | an integer
`cancellable` : | optional `gio.Cancellable` object, `None` to ignore.
`user_data` : | the data to pass to callback function.

The `load_async`() method loads an icon asynchronously.

For more details, see `gio.LoadableIcon.load`() which is the synchronous version of this call.

When the operation is finished, callback will be called. You can then call `gio.LoadableIcon.load_finish`() to get the result of the operation.

### gio.LoadableIcon.load_finish

        def load_finish(res)

`res` : | a `gio.AsyncResult`.
Returns : | a 2 tuple containing a `gio.InputStream` to read the icon from and a string containing the icon type.

The `load_finish`() method finishes an asynchronous icon load started in `gio.LoadableIcon.load_async`().

Prev | Up | Next
gio.InputStream | Home | gio.MemoryInputStream