functions

LayoutToWidget
Edited: Sunday 25 January 2026

LayoutToWidget

Category: Utilities
File: layouts.go
Package: ui

Signature

1func LayoutToWidget(r func(C, W) D, w W) W

Description

LayoutToWidget converts a layout function that takes (C, W) into a standard widget (W).
This bridges the gap between Gio’s layout patterns and this library’s widget system.

Example:

widget := LayoutToWidget(clickable.Layout, Label("Clickable text"))

Commonly used to wrap clickable areas or custom layout functions.

Examples

LayoutToWidget

1{
2	btn := &Clickable{}
3	widget := LayoutToWidget(btn.Layout, Label("Clickable"))
4	_ = widget
5}

Example Output


This documentation is auto-generated. To update, run make docs

Backlinks