Menu

1 / 4

GitHub - rxi/microui: A tiny immediate-mode UI library

Hacker News·5 months ago
#7QPaYS50
#github#library#usage#controls#mu_label
Reading 0:00
15s threshold

A tiny , portable, immediate-mode UI library written in ANSI C

Features

Tiny: around 1100 sloc of ANSI C

Works within a fixed-sized memory region: no additional memory is allocated

Built-in controls: window, scrollable panel, button, slider, textbox, label, checkbox, wordwrapped text

Works with any rendering system that can draw rectangles and text

Designed to allow the user to easily add custom controls

Simple layout system

Example

<div dir="auto" data-snippet-clipboard-copy-content="if (mu_begin_window(ctx, "My Window", mu_rect(10, 10, 140, 86))) { mu_layout_row(ctx, 2, (int[]) { 60, -1 }, 0);

mu_label(ctx, "First:"); if (mu_button(ctx, "Button1")) { printf("Button1 pressed\n"); }

mu_label(ctx, "Second:"); if (mu_button(ctx, "Button2")) { mu_open_popup(ctx, "My Popup"); }

if (mu_begin_popup(ctx, "My Popup")) { mu_label(ctx, "Hello world!"); mu_end_popup(ctx); }

mu_end_window(ctx); }"> if ( mu_begin_window ( ctx , "My Window" , mu_rect ( 10 , 10 , 140 , 86 ))) { mu_layout_row ( ctx , 2 , ( int…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.