mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	LKML <linux-kernel@vger.kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	David Ahern <dsahern@gmail.com>,
	Stephane Eranian <eranian@google.com>,
	Pekka Enberg <penberg@kernel.org>
Subject: [PATCH 4/5] perf gtk/hists: Add a double-click handler for callchains
Date: Wed, 22 May 2013 17:27:37 +0900	[thread overview]
Message-ID: <1369211258-3163-5-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1369211258-3163-1-git-send-email-namhyung@kernel.org>

From: Namhyung Kim <namhyung.kim@lge.com>

If callchain is displayed, add "row-activated" signal handler for
handling double-click or pressing ENTER key action.

Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/gtk/hists.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 34a09c09748c..4e96f7a9f6d1 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -175,6 +175,18 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
 	}
 }
 
+static void on_row_activated(GtkTreeView *view, GtkTreePath *path,
+			     GtkTreeViewColumn *col __maybe_unused,
+			     gpointer user_data __maybe_unused)
+{
+	bool expanded = gtk_tree_view_row_expanded(view, path);
+
+	if (expanded)
+		gtk_tree_view_collapse_row(view, path);
+	else
+		gtk_tree_view_expand_row(view, path, FALSE);
+}
+
 static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 				 float min_pcnt)
 {
@@ -315,6 +327,8 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		}
 	}
 
+	g_signal_connect(view, "row-activated",
+			 G_CALLBACK(on_row_activated), NULL);
 	gtk_container_add(GTK_CONTAINER(window), view);
 }
 
-- 
1.7.11.7


  parent reply	other threads:[~2013-05-22  8:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  8:27 [PATCH 0/5] perf report: Add support for callchains on GTK browser Namhyung Kim
2013-05-22  8:27 ` [PATCH 1/5] perf gtk/hists: Use GtkTreeStore instead of GtkListStore Namhyung Kim
2013-05-22  8:37   ` Pekka Enberg
2013-05-22  8:27 ` [PATCH 2/5] perf gtk/hists: Add support for callchains Namhyung Kim
2013-05-22  8:38   ` Pekka Enberg
2013-05-22  8:27 ` [PATCH 3/5] perf gtk/hists: Display callchain overhead also Namhyung Kim
2013-05-22  8:39   ` Pekka Enberg
2013-05-22  9:52   ` Arnaldo Carvalho de Melo
2013-05-23  2:37     ` Namhyung Kim
2013-05-28  8:48     ` Ingo Molnar
2013-06-02  2:50       ` Namhyung Kim
2013-05-22  8:27 ` Namhyung Kim [this message]
2013-05-22  8:39   ` [PATCH 4/5] perf gtk/hists: Add a double-click handler for callchains Pekka Enberg
2013-05-22  8:27 ` [PATCH 5/5] perf gtk/hists: Make column headers resizable Namhyung Kim
2013-05-22  8:37   ` [PATCH v2 " Namhyung Kim
2013-05-22  8:39     ` Pekka Enberg
2013-05-22  8:40 ` [PATCH 0/5] perf report: Add support for callchains on GTK browser 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=1369211258-3163-5-git-send-email-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    --cc=penberg@kernel.org \
    /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

all inboxes | Powered by JetHome®