GLib.Source.new

function new(source_funcs: GLib.SourceFuncs, struct_size: Number(guint)): GLib.Source {
    // Gjs wrapper for g_source_new()
}
  

Creates a new GLib.Source structure. The size is specified to allow creating structures derived from GLib.Source that contain additional data. The size passed in must be at least `sizeof (GSource)`.

The source will not initially be associated with any GLib.MainContext and must be added to one with GLib.Source.prototype.attach before it will be executed.

source_funcs

structure containing functions that implement the sources behavior.

struct_size

size of the GLib.Source structure to create.

Returns

the newly-created GLib.Source.