Clone
4
Widgets
Maxwell Jeffress edited this page 2025-11-08 12:28:00 +00:00

Widgets

Quip uses a widget-based system to show things on a screen. Each widget has it's own purpose and properties.

Creating and Modifying Widgets

See the "Window" page for information on this.

List of Avaliable Widgets

Quip::Widget::TextLabel(std::string text, Quip::Font font)

Summary

The TextLabel widget allows you to render text on the screen.

Members

std::string text: The text to be displayed.

Quip::Font font: The font for the text to be rendered in.

Example

Quip::Widget::TextLabel("Hello!", Quip::Font("/path/to/font.ttf", 16));

Quip::Widget::Button(Quip::TextLabel text, std::function<void()> callback)

Summary

The Button widget creates a clickable button which runs a provided function upon click. Takes a textlabel which is the text displayed on the button.

Members

Quip::TextLabel text: The textlabel to be displayed.

std::function<void()> callback: The function to be run when the button is pressed.

Example

Quip::Widget::Button("Click me!", []() {
    std::cout << "Button has been clicked!" << std::endl;
})

Quip::Widget::Image(std::string filepath, int width = -1, int height = -1)

Summary

The Image widget renders an image given at a provided filepath. If width and height are values below 0, the image will be displayed at it's normal resolution.

Members

std::string filepath: The path to look for the image in.

int width, height: The width and height of the image.

Example

Quip::Widget::Image("image.png", 100, 100);