---
name: "wofi-widget-builder"
section: "3"
platform: "linux"
package: "wofi"
version: "1.5.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/wofi-widget-builder"
---

# wofi-widget-builder(3)

Widget builder API functions

## NAME

wofi - Widget builder API functions

## DESCRIPTION

The functions documented here are used for building custom widgets with more power and flexibility than previously allowed. They are defined in wofi\_widget\_builder\_api.h

- **struct widget\_builder\* wofi\_widget\_builder\_init(struct mode\* mode, size\_t actions)**

  Creates multiple widget builders. The number of builders created is specified by actions and is returned as an array.

  **struct mode\* mode** - The **struct mode\*** given to your mode's **init()** function.

  **size\_t actions** - The number of builders to create

- **void wofi\_widget\_builder\_set\_search\_text(struct widget\_builder\* builder, char\* search\_text)**

  Sets the search text for the widget specified by the builder

  **struct widget\_builder\* builder** - The builder that contains the widget to set the search text for

  **char\* search\_text** - The text to set as the search text

- **void wofi\_widget\_builder\_set\_action(struct widget\_builder\* builder, char\* action)**

  Sets the action for the widget specified by the builder

  **struct widget\_builder\* builder** - The builder that contains the widget to set the action for

  **char\* action** - The text to set as the action

- **void wofi\_widget\_builder\_insert\_text(struct widget\_builder\* builder, char\* text, ...)**

  Inserts text into the widget specified by the builder

  **struct widget\_builder\* builder** - The builder that contains the widget to add the text to

  **char\* text** - The text to add to the widget

  **...** - The names of the CSS classes for this text. The class that will be assigned is .mode\_name-css\_name where mode\_name is the name of the mode, i.e. drun etc. This should have a NULL sentinel

- **void wofi\_widget\_builder\_insert\_text\_with\_list(struct widget\_builder\* builder, char\* text, struct wl\_list\* classes)**

  Inserts text into the widget specified by the builder

  **struct widget\_builder\* builder** - The builder that contains the widget to add the text to

  **char\* text** - The text to add to the widget

  **struct wl\_list\* classes** - The names of the CSS classes for this text. The class that will be assigned is .mode\_name-css\_name where mode\_name is the name of the mode, i.e. drun etc. This list should contain struct css\_class nodes.

- **void wofi\_widget\_builder\_insert\_image(struct widget\_builder\* builder, GdkPixbuf\* pixbuf, ...)**

  Inserts an image into the widget specified by the builder

  **struct widget\_builder\* builder** - The builder that contains the widget to add the image to

  **GdkPixbuf\* pixbuf** - The image to add to the widget

  **...** - The names of the CSS classes for this image. The class that will be assigned is .mode\_name-css\_name where mode\_name is the name of the mode, i.e. drun etc. This should have a NULL sentinel

- **void wofi\_widget\_builder\_insert\_image\_with\_list(struct widget\_builder\* builder, GdkPixbuf\* pixbuf, struct wl\_list\* classes)**

  Inserts an image into the widget specified by the builder

  **struct widget\_builder\* builder** - The builder that contains the widget to add the image to

  **GdkPixbuf\* pixbuf** - The image to add to the widget

  **struct wl\_list\* classes** - The names of the CSS classes for this image. The class that will be assigned is .mode\_name-css\_name where mode\_name is the name of the mode, i.e. drun etc. This list should contain struct css\_class nodes.

- **struct widget\_builder\* wofi\_widget\_builder\_get\_idx(struct widget\_builder\* builder, size\_t idx)**

  Gets the widget\_builder at the provided index in the array

  **struct widget\_builder\* builder** - The array of builders to get the builder from

  **size\_t idx** - The index in the array to get

- **struct widget\* wofi\_widget\_builder\_get\_widget(struct widget\_builder\* builder)**

  Constructs a new widget from the specified builder, the widget can be returned by **struct widget\* get\_widget(void)**

  **struct widget\_builder\* builder** - The builder to construct a widget for

- **void wofi\_widget\_builder\_free(struct widget\_builder\* builder)**

  Frees the specified builder

  **struct widget\_builder\* builder** - The builder to free
