Merge pull request #246 from flederfalter/ttt/master
update example to recent api changes
This commit is contained in:
commit
a7e97e53ac
13
Readme.md
13
Readme.md
@ -59,19 +59,18 @@ float value = 0.6f;
|
||||
int i = 20;
|
||||
|
||||
struct nk_panel layout;
|
||||
nk_begin(&ctx, &layout, "Show", nk_rect(50, 50, 220, 220),
|
||||
NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE);
|
||||
{
|
||||
if (nk_begin(&ctx, &layout, "Show", nk_rect(50, 50, 220, 220),
|
||||
NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
|
||||
/* fixed widget pixel width */
|
||||
nk_layout_row_static(&ctx, 30, 80, 1);
|
||||
if (nk_button_text(&ctx, "button", NK_BUTTON_DEFAULT)) {
|
||||
if (nk_button_label(&ctx, "button")) {
|
||||
/* event handling */
|
||||
}
|
||||
|
||||
/* fixed widget window ratio width */
|
||||
nk_layout_row_dynamic(&ctx, 30, 2);
|
||||
if (nk_option(&ctx, "easy", op == EASY)) op = EASY;
|
||||
if (nk_option(&ctx, "hard", op == HARD)) op = HARD;
|
||||
if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
|
||||
if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD;
|
||||
|
||||
/* custom widget pixel width */
|
||||
nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
|
||||
@ -83,7 +82,7 @@ nk_begin(&ctx, &layout, "Show", nk_rect(50, 50, 220, 220),
|
||||
}
|
||||
nk_layout_row_end(&ctx);
|
||||
}
|
||||
nk_end(ctx);
|
||||
nk_end(&ctx);
|
||||
```
|
||||
![example](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user