Skip to content

API Reference / @gtkx/runtime / setBoxedValue

Function: setBoxedValue() ​

setBoxedValue(value, boxed): void

Defined in: packages/runtime/src/value.ts:412

Stores a boxed object, or null, into a GValue that holds a boxed type. A GValue holding G_TYPE_VALUE also takes any other JsValue, which is boxed into a nested GObject.Value of the GType inferred from it, and one holding a GByteArray also takes the bytes as a Uint8Array or an array of byte values.

Parameters ​

value ​

ExternalObject<Handle>

Handle of an initialized value to write into.

boxed ​

object | JsValue

The boxed instance, bytes, or JsValue to store.

Returns ​

void

Throws ​

When the value cannot hold what was passed.