LoadableIcon

class LoadableIcon(*args, **kwargs)

Implementations: BytesIcon, FileIcon

GLoadableIcon extends the Icon interface and adds the ability to load icons from streams.

Methods

class LoadableIcon
load(size: int, cancellable: Cancellable | None = None) tuple[InputStream, str]

Loads a loadable icon. For the asynchronous version of this function, see load_async().

Parameters:
  • size – an integer.

  • cancellable – optional Cancellable object, None to ignore.

load_async(size: int, cancellable: Cancellable | None = None, callback: Callable[[...], None] | None = None, *user_data: Any) None

Loads an icon asynchronously. To finish this function, see load_finish(). For the synchronous, blocking version of this function, see load().

Parameters:
  • size – an integer.

  • cancellable – optional Cancellable object, None to ignore.

  • callback – a AsyncReadyCallback to call when the request is satisfied

  • user_data – the data to pass to callback function

load_finish(res: AsyncResult) tuple[InputStream, str]

Finishes an asynchronous icon load started in load_async().

Parameters:

res – a AsyncResult.

Virtual Methods

class LoadableIcon
do_load(size: int, cancellable: Cancellable | None = None) tuple[InputStream, str]

Loads a loadable icon. For the asynchronous version of this function, see load_async().

Parameters:
  • size – an integer.

  • cancellable – optional Cancellable object, None to ignore.

do_load_async(size: int, cancellable: Cancellable | None = None, callback: Callable[[...], None] | None = None, *user_data: Any) None

Loads an icon asynchronously. To finish this function, see load_finish(). For the synchronous, blocking version of this function, see load().

Parameters:
  • size – an integer.

  • cancellable – optional Cancellable object, None to ignore.

  • callback – a AsyncReadyCallback to call when the request is satisfied

  • user_data – the data to pass to callback function

do_load_finish(res: AsyncResult) tuple[InputStream, str]

Finishes an asynchronous icon load started in load_async().

Parameters:

res – a AsyncResult.