diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-11-27 21:50:49 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-11-27 21:50:49 +0000 |
commit | a4cc25f84d04835a8283176ba4a058b5ac2966e2 (patch) | |
tree | 7ffed53d8b537c9a207f28b5438525b428cc21d5 /gtk/main_statusbar.c | |
parent | 52b99dc1918626e758f4c3ef2566dfb49958db1b (diff) |
Move main_statusbar.h to the top-level directory; none of its routines
use GTK+ data types, so, at least in theory, it could be implemented
atop another toolkit.
Make statusbar_push_temporary_msg() take a format string and format
arguments. Use it instead of simple_status(), and change one call to
just take a format string and arguments rather than to take the result
of using that format string and arguments with g_strdup_printf() and
passing the result to statusbar_push_temporary_msg().
svn path=/trunk/; revision=35041
Diffstat (limited to 'gtk/main_statusbar.c')
-rw-r--r-- | gtk/main_statusbar.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk/main_statusbar.c b/gtk/main_statusbar.c index 5a55c4e726..eae9b22b20 100644 --- a/gtk/main_statusbar.c +++ b/gtk/main_statusbar.c @@ -48,7 +48,6 @@ #include "gtk/recent.h" #include "gtk/main.h" -#include "gtk/main_statusbar.h" #include "gtk/main_statusbar_private.h" #include "gtk/gui_utils.h" #include "gtk/gtkglobals.h" @@ -59,6 +58,8 @@ #include "gtk/keys.h" #include "gtk/menus.h" +#include "main_statusbar.h" + /* * The order below defines the priority of info bar contexts. */ @@ -231,14 +232,21 @@ statusbar_flash_temporary_msg(gpointer data _U_) } /* - * Push a temporary message onto the statusbar. + * Push a formatted temporary message onto the statusbar. */ void -statusbar_push_temporary_msg(const gchar *msg) +statusbar_push_temporary_msg(const gchar *msg_format, ...) { + va_list ap; + gchar *msg; guint msg_id; + va_start(ap, msg_format); + msg = g_strdup_vprintf(msg_format, ap); + va_end(ap); + msg_id = gtk_statusbar_push(GTK_STATUSBAR(info_bar), main_ctx, msg); + g_free(msg); flash_time = TEMPORARY_FLASH_TIMEOUT - 1; g_timeout_add(TEMPORARY_FLASH_INTERVAL, statusbar_flash_temporary_msg, NULL); |