diff options
author | 2008-09-23 09:39:14 -0400 | |
---|---|---|
committer | 2008-09-23 09:39:14 -0400 | |
commit | 671153c765a1b2899bed564c50d718f9244f3287 (patch) | |
tree | 6a6eaf8decf80a833cf73cccc0d186edff3e3247 | |
parent | 7a99258f7284bd2167840781b65c8a4f1e331ade (diff) | |
download | textadept-671153c765a1b2899bed564c50d718f9244f3287.tar.gz textadept-671153c765a1b2899bed564c50d718f9244f3287.zip |
Merged 'set_docstatusbar_text' function into 'set_statusbar_text' with a flag.
-rw-r--r-- | src/lua_interface.c | 4 | ||||
-rw-r--r-- | src/textadept.c | 24 | ||||
-rw-r--r-- | src/textadept.h | 3 |
3 files changed, 11 insertions, 20 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c index 7fcf3ee7..9b9163ce 100644 --- a/src/lua_interface.c +++ b/src/lua_interface.c @@ -1121,9 +1121,9 @@ LF l_ta_mt_newindex(LS *lua) { if (streq(key, "title")) gtk_window_set_title(GTK_WINDOW(window), lua_tostring(lua, 3)); else if (streq(key, "statusbar_text")) - set_statusbar_text(lua_tostring(lua, 3)); + set_statusbar_text(lua_tostring(lua, 3), false); else if (streq(key, "docstatusbar_text")) - set_docstatusbar_text(lua_tostring(lua, 3)); + set_statusbar_text(lua_tostring(lua, 3), true); else if (streq(key, "focused_doc_pointer") || streq(key, "clipboard_text")) luaL_error(lua, "'%s' is read-only.", key); else if (streq(key, "menubar")) { diff --git a/src/textadept.c b/src/textadept.c index a500a699..82343f43 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -370,22 +370,14 @@ void set_menubar(GtkWidget *new_menubar) { /** * Sets the notification statusbar text. * @param text The text to display. - */ -void set_statusbar_text(const char *text) { - if (!statusbar) return; - gtk_statusbar_pop(GTK_STATUSBAR(statusbar), 0); - gtk_statusbar_push(GTK_STATUSBAR(statusbar), 0, text); -} - -/** - * Sets the document status statusbar text. - * This is typically set via a Scintilla 'UpdateUI' notification. - * @param text The text to display. - */ -void set_docstatusbar_text(const char *text) { - if (!docstatusbar) return; - gtk_statusbar_pop(GTK_STATUSBAR(docstatusbar), 0); - gtk_statusbar_push(GTK_STATUSBAR(docstatusbar), 0, text); + * @param docbar Flag indicating whether or not the statusbar text is for the + * docstatusbar. + */ +void set_statusbar_text(const char *text, bool docbar) { + GtkWidget *bar = docbar ? docstatusbar : statusbar; + if (!bar) return; + gtk_statusbar_pop(GTK_STATUSBAR(bar), 0); + gtk_statusbar_push(GTK_STATUSBAR(bar), 0, text); } /** diff --git a/src/textadept.h b/src/textadept.h index 52e8a315..581be76f 100644 --- a/src/textadept.h +++ b/src/textadept.h @@ -51,8 +51,7 @@ void remove_scintilla_buffer(sptr_t doc); void split_window(GtkWidget *editor, bool vertical); bool unsplit_window(GtkWidget *editor); void set_menubar(GtkWidget *menubar); -void set_statusbar_text(const char *text); -void set_docstatusbar_text(const char *text); +void set_statusbar_text(const char *text, bool docbar); void ce_toggle_focus(); GtkWidget *pm_create_ui(); |