From d49b669db99c93a01a689715e88ce295acf60843 Mon Sep 17 00:00:00 2001 From: vurtun Date: Tue, 12 Jul 2016 15:47:53 +0200 Subject: [PATCH] Added function to modify window title --- nuklear.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nuklear.h b/nuklear.h index 19c4824..48ed86f 100644 --- a/nuklear.h +++ b/nuklear.h @@ -555,6 +555,7 @@ NK_API int nk_item_is_any_active(struct nk_context*); NK_API void nk_window_set_bounds(struct nk_context*, struct nk_rect); NK_API void nk_window_set_position(struct nk_context*, struct nk_vec2); NK_API void nk_window_set_size(struct nk_context*, struct nk_vec2); +NK_API void nk_window_set_title(struct nk_context*, const char *title_to_set); NK_API void nk_window_set_focus(struct nk_context*, const char *name); NK_API void nk_window_close(struct nk_context *ctx, const char *name); @@ -2360,7 +2361,7 @@ struct nk_window { struct nk_property_state property; struct nk_popup_state popup; struct nk_edit_state edit; - unsigned int scrolled; + unsigned int scrolled; struct nk_table *tables; unsigned short table_count; @@ -15429,6 +15430,18 @@ nk_window_set_size(struct nk_context *ctx, struct nk_vec2 size) ctx->current->bounds.h = size.y; } +NK_API void +nk_window_set_title(struct nk_context *ctx, const char *title) +{ + int title_len; + nk_hash title_hash; + NK_ASSERT(ctx); NK_ASSERT(ctx->current); + if (!ctx || !ctx->current) return; + title_len = (int)nk_strlen(title); + title_hash = nk_murmur_hash(title, (int)title_len, NK_WINDOW_TITLE); + ctx->current->name = title_hash; +} + NK_API void nk_window_collapse(struct nk_context *ctx, const char *name, enum nk_collapse_states c)