public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Namhyung Kim <namhyung@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl,
	penberg@kernel.org, namhyung@gmail.com, tglx@linutronix.de
Subject: [tip:perf/core] perf ui/gtk: Add GTK statusbar widget to browser window
Date: Wed, 20 Jun 2012 09:47:43 -0700	[thread overview]
Message-ID: <tip-b4418c6848dcd56cc90625dcfaef7cb019492233@git.kernel.org> (raw)
In-Reply-To: <1338265382-6872-6-git-send-email-namhyung@gmail.com>

Commit-ID:  b4418c6848dcd56cc90625dcfaef7cb019492233
Gitweb:     http://git.kernel.org/tip/b4418c6848dcd56cc90625dcfaef7cb019492233
Author:     Namhyung Kim <namhyung@gmail.com>
AuthorDate: Tue, 29 May 2012 13:23:00 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 19 Jun 2012 13:06:19 -0300

perf ui/gtk: Add GTK statusbar widget to browser window

Add statusbar widget to display non-critical messages at the bottom of
the window. This can be used for showing a status change, warning or
help message.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1338265382-6872-6-git-send-email-namhyung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/gtk/browser.c |   26 +++++++++++++++++++++++++-
 tools/perf/ui/gtk/gtk.h     |    2 ++
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/tools/perf/ui/gtk/browser.c b/tools/perf/ui/gtk/browser.c
index 33ab1ae..ece360d 100644
--- a/tools/perf/ui/gtk/browser.c
+++ b/tools/perf/ui/gtk/browser.c
@@ -122,13 +122,30 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists)
 	gtk_container_add(GTK_CONTAINER(window), view);
 }
 
+static GtkWidget *perf_gtk__setup_statusbar(void)
+{
+	GtkWidget *stbar;
+	unsigned ctxid;
+
+	stbar = gtk_statusbar_new();
+
+	ctxid = gtk_statusbar_get_context_id(GTK_STATUSBAR(stbar),
+					     "perf report");
+	pgctx->statbar = stbar;
+	pgctx->statbar_ctx_id = ctxid;
+
+	return stbar;
+}
+
 int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist,
 				  const char *help __used,
 				  void (*timer) (void *arg)__used,
 				  void *arg __used, int delay_secs __used)
 {
 	struct perf_evsel *pos;
+	GtkWidget *vbox;
 	GtkWidget *notebook;
+	GtkWidget *statbar;
 	GtkWidget *window;
 
 	signal(SIGSEGV, perf_gtk__signal);
@@ -147,6 +164,8 @@ int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist,
 	if (!pgctx)
 		return -1;
 
+	vbox = gtk_vbox_new(FALSE, 0);
+
 	notebook = gtk_notebook_new();
 
 	list_for_each_entry(pos, &evlist->entries, node) {
@@ -168,7 +187,12 @@ int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist,
 		gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled_window, tab_label);
 	}
 
-	gtk_container_add(GTK_CONTAINER(window), notebook);
+	gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
+
+	statbar = perf_gtk__setup_statusbar();
+	gtk_box_pack_start(GTK_BOX(vbox), statbar, FALSE, FALSE, 0);
+
+	gtk_container_add(GTK_CONTAINER(window), vbox);
 
 	gtk_widget_show_all(window);
 
diff --git a/tools/perf/ui/gtk/gtk.h b/tools/perf/ui/gtk/gtk.h
index 34fbca6..2061678 100644
--- a/tools/perf/ui/gtk/gtk.h
+++ b/tools/perf/ui/gtk/gtk.h
@@ -10,6 +10,8 @@
 
 struct perf_gtk_context {
 	GtkWidget *main_window;
+	GtkWidget *statbar;
+	guint statbar_ctx_id;
 };
 
 extern struct perf_gtk_context *pgctx;

  reply	other threads:[~2012-06-20 16:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29  4:22 [PATCH 0/7] perf ui: Add basic error handling for GTK2 front-end (v3) Namhyung Kim
2012-05-29  4:22 ` [PATCH RESEND 1/7] perf ui: Make --stdio default when TUI is not supported Namhyung Kim
2012-05-29  4:22 ` [PATCH 2/7] perf tools: Convert critical messages to ui__error() Namhyung Kim
2012-05-30  7:49   ` [tip:perf/urgent] " tip-bot for Namhyung Kim
2012-05-29  4:22 ` [PATCH 3/7] perf ui: Introduce struct perf_error_ops Namhyung Kim
2012-06-20 16:45   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-05-29  4:22 ` [PATCH 4/7] perf ui/gtk: Introduce struct perf_gtk_context Namhyung Kim
2012-06-20 16:46   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-05-29  4:23 ` [PATCH 5/7] perf ui/gtk: Add GTK statusbar widget to browser window Namhyung Kim
2012-06-20 16:47   ` tip-bot for Namhyung Kim [this message]
2012-05-29  4:23 ` [PATCH 6/7] perf ui/gtk: Add GTK info_bar " Namhyung Kim
2012-06-20 16:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-05-29  4:23 ` [PATCH 7/7] perf ui/gtk: Use struct perf_error_ops Namhyung Kim
2012-06-20 16:49   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-05-30  1:31 ` [PATCH 0/7] perf ui: Add basic error handling for GTK2 front-end (v3) Arnaldo Carvalho de Melo
2012-05-30  6:19   ` Pekka Enberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-b4418c6848dcd56cc90625dcfaef7cb019492233@git.kernel.org \
    --to=namhyung@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=penberg@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox