Gly.Loader¶
- Subclasses:
 None
Methods¶
- Inherited:
 - Structs:
 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
Properties¶
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w  | 
|||
r/w/co  | 
|||
r/w  | 
Signals¶
- Inherited:
 
Fields¶
- Inherited:
 
Class Details¶
- class Gly.Loader(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
[class`Loader`] prepares loading an image.
The following example shows how to obtain a [class`Gdk`.Texture]. It uses GlyGtk4 for this.
```c #include <glycin-gtk4.h>
file =
Gio.File.new_for_path(“test.png”); loader =Gly.Loader.new(file); image =Gly.Loader.load(loader,None); if (image) { frame =Gly.Image.next_frame(image,None); if (frame) { texture = gly_gtk_frame_get_texture (frame); printf (“Image height: %d\n”,Gdk.Texture.get_height(texture)); image_widget = gtk_image_new_from_paintable (GDK_PAINTABLE (texture)); } } ```New in version 1.0.
- classmethod new(file)¶
 - Parameters:
 file (
Gio.File) – A [iface`Gio`.File] from which to load- Returns:
 a new [class`Loader`]
- Return type:
 
Creates a new [class`Loader`].
New in version 1.0.
- load()¶
 - Raises:
 - Returns:
 a new [class`Image`] on success, or
NULLwith error filled in- Return type:
 
Synchronously loads an image and returns an [class`Image`] when successful.
New in version 1.0.
- load_async(cancellable, callback, *user_data)¶
 - Parameters:
 cancellable (
Gio.CancellableorNone) – A [class`Gio`.Cancellable] to cancel the operationcallback (
Gio.AsyncReadyCallbackorNone) – A callback to call when the operation is complete
Asynchronous version of [method`Loader`.load].
New in version 1.0.
- load_finish(result)¶
 - Parameters:
 result (
Gio.AsyncResult) – AGAsyncResult- Raises:
 - Returns:
 Loaded frame.
- Return type:
 
Finishes the [method`Image`.next_frame_async] call.
New in version 1.0.
- set_sandbox_selector(sandbox_selector)¶
 - Parameters:
 sandbox_selector (
Gly.SandboxSelector) – Method by which the sandbox mechanism is selected
Selects which sandbox mechanism should be used. The default without calling this function is [enum`SandboxSelector`]``.AUTO``.
New in version 1.0.
Property Details¶
- Gly.Loader.props.cancellable¶
 - Name:
 cancellable- Type:
 - Default Value:
 - Flags:
 
- Gly.Loader.props.file¶
 - Name:
 file- Type:
 - Default Value:
 - Flags:
 
- Gly.Loader.props.sandbox_selector¶
 - Name:
 sandbox-selector- Type:
 - Default Value:
 - Flags: