Nuklear/demo/simple.c
vurtun fdbcc52629 Merged examples and demos into one (first step)
While dividing previously spared me from a lot of work and problems
it is probably best to have everything working for every or as many
platforms as possible. Some platforms fail to provide good ways
to support everything (e.g.:X11 does not have pixmap clipping with
different width/height or alpha-blending) but all OpenGL demos
outside allegro (needs some additional work) should be able to run.
2016-02-11 23:29:02 +01:00

28 lines
861 B
C

static void
simple_window(struct zr_context *ctx)
{
/* simple demo window */
struct zr_panel layout;
if (zr_begin(ctx, &layout, "Show", zr_rect(420, 350, 200, 200),
ZR_WINDOW_BORDER|ZR_WINDOW_MOVABLE|ZR_WINDOW_SCALABLE|
ZR_WINDOW_CLOSABLE|ZR_WINDOW_MINIMIZABLE|ZR_WINDOW_TITLE))
{
enum {EASY, HARD};
static int op = EASY;
static int property = 20;
zr_layout_row_static(ctx, 30, 80, 1);
if (zr_button_text(ctx, "button", ZR_BUTTON_DEFAULT)) {
/* event handling */
}
zr_layout_row_dynamic(ctx, 30, 2);
if (zr_option(ctx, "easy", op == EASY)) op = EASY;
if (zr_option(ctx, "hard", op == HARD)) op = HARD;
zr_layout_row_dynamic(ctx, 22, 1);
zr_property_int(ctx, "Compression:", 0, &property, 100, 10, 1);
}
zr_end(ctx);
}