sco_widgets_v1.set_panel
Atomically adds/replaces an owned complete preorder tree. ID/title <=63 bytes; 1..256 nodes, aligned stride >=80 and node size within stride. Unique nonzero node IDs, parent 0 or preceding active ROW/COLUMN; all subtrees contiguous. Copies valid UTF-8 labels/text/items <=255 bytes; 256 items/node and 16 table columns. Zero unused fields; finite/ranged numeric values and valid selections. Failure preserves old tree/callback.
Signature
Section titled “Signature”sco_result (*)(sco_plugin *, const char *, const char *, const sco_widget_node *, uint32_t, uint32_t, sco_widget_event_fn, void *)Service and availability
Section titled “Service and availability”| Property | Value |
|---|---|
| Symbol | sco_widgets_v1.set_panel |
| Record ID | sco-widgets-v1-set-panel |
| Service | sco.widgets |
| Table | sco_widgets_v1 |
| Version macro | SCO_WIDGETS_VERSION_1_1 |
| Packed table version | 65537 |
| Since / availability | size >= 16; 1.0 |
| Complete member extent (x64 bytes) | 16 |
| Table size (x64 bytes) | 48 |
Parameters and buffers
Section titled “Parameters and buffers”sco_result (*set_panel)(sco_plugin* self, const char* id, const char* title, const sco_widget_node* nodes, uint32_t count, uint32_t node_stride, sco_widget_event_fn fn, void* ctx);
Atomically adds/replaces an owned complete preorder tree. ID/title <=63 bytes; 1..256 nodes, aligned stride >=80 and node size within stride. Unique nonzero node IDs, parent 0 or preceding active ROW/COLUMN; all subtrees contiguous. Copies valid UTF-8 labels/text/items <=255 bytes; 256 items/node and 16 table columns. Zero unused fields; finite/ranged numeric values and valid selections. Failure preserves old tree/callback.
Results and failures
Section titled “Results and failures”OK; WRONG_THREAD off game thread; UNAVAILABLE stopped service/host; BAD_ARG malformed owner/ID/title/tree/size/stride/data; TOO_MANY limits or allocation failure. Failure atomic.
Absent capability
Section titled “Absent capability”query_service NOT_FOUND absent service; UNAVAILABLE incompatible version. No game capability or renderer requirement.
Ownership
Section titled “Ownership”Host deep-copies tree/strings on success; fn/ctx borrowed until successful replacement/removal or ordinary owner release. No allocation transfer.
Thread affinity
Section titled “Thread affinity”Game thread only; WRONG_THREAD elsewhere. Callbacks game thread under owner callout guard.
Callback context
Section titled “Callback context”Event, text and panel ID borrowed during callback only; callback ctx is plugin-owned.
Reentrancy
Section titled “Reentrancy”Callbacks may invoke commands or replace/remove own panel; generation change drops remaining stale events, new tree renders next pass. Registry lock not held during plugin code.
Cleanup and cancellation
Section titled “Cleanup and cancellation”Successful replacement/removal and ordinary owner release discard stale-generation events and end borrowed callbacks. Fault guard stops delivery; retained-provider faults skip ordinary resource release until restart. No separate cancel token.
Language mappings
Section titled “Language mappings”Status labels are copied verbatim from the catalogue: direct is native access; typed-wrapper is wrapper-backed; restricted is a subset/adaptation; unsupported means no supported route is established. No status implies universal safety.
| Language | Catalogue status | Source evidence / wrapper tokens |
|---|---|---|
| c | direct | include/sco_widgets.h(*set_panel) |
| cpp | typed-wrapper | include/scosdk/widgets.hppreturn table_->set_panel(self_, id, title, nodes, count, stride, fn, ctx); |
| csharp | typed-wrapper | sdk/csharp/Sco.Sdk/Widgets.cs_t->set_panel(_plugin.SelfPtrsdk/csharp/Sco.Sdk/Widgets.cs _t->remove_panel(_plugin.SelfPtrsdk/csharp/Sco.Sdk/WidgetsInterop.cs public unsafe struct ScoWidgetsV1 |
| lua | typed-wrapper | plugins/lua/sco_lua.ct->set_panel(s->selfplugins/lua/sco_lua.c t->remove_panel(s->self |
Examples
Section titled “Examples”- sdk/examples/widgets/widgets.c
- sdk/examples/widgets_lua/main.lua
- sdk/examples/cs_widgets/WidgetsExample.cs
- tests/abi_widgets.c
- tests/test_widgets.cpp
- tests/test_widgets_sdk.cpp
- tests/test_lua.cpp
- sdk/csharp/Sco.Sdk.Tests/WidgetsTests.cs
- sdk/csharp/Sco.Sdk.Tests/WidgetsPins.cs
- sdk/test-zip.sh
ABI pins prove layout, not semantic behavior or a live game session.