6 #include "../helpline.h"
7 #include "../../util/debug.h"
9 static void gtk_helpline_pop(void)
11 if (!perf_gtk__is_active_context(pgctx))
14 gtk_statusbar_pop(GTK_STATUSBAR(pgctx->statbar),
15 pgctx->statbar_ctx_id);
18 static void gtk_helpline_push(const char *msg)
20 if (!perf_gtk__is_active_context(pgctx))
23 gtk_statusbar_push(GTK_STATUSBAR(pgctx->statbar),
24 pgctx->statbar_ctx_id, msg);
27 static struct ui_helpline gtk_helpline_fns = {
28 .pop = gtk_helpline_pop,
29 .push = gtk_helpline_push,
32 void perf_gtk__init_helpline(void)
34 helpline_fns = >k_helpline_fns;
37 int perf_gtk__show_helpline(const char *fmt, va_list ap)
43 ret = vscnprintf(ui_helpline__current + backlog,
44 sizeof(ui_helpline__current) - backlog, fmt, ap);
47 /* only first line can be displayed */
48 ptr = strchr(ui_helpline__current, '\n');
49 if (ptr && (ptr - ui_helpline__current) <= backlog) {
51 ui_helpline__puts(ui_helpline__current);