Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312265
b: refs/heads/master
c: b4418c6
h: refs/heads/master
i:
  312263: 3af7896
v: v3
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Jun 19, 2012
1 parent a0d828a commit 14749d0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42ab68a35ffee04700648ec42c9507145a66837d
refs/heads/master: b4418c6848dcd56cc90625dcfaef7cb019492233
26 changes: 25 additions & 1 deletion trunk/tools/perf/ui/gtk/browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand All @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/ui/gtk/gtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

struct perf_gtk_context {
GtkWidget *main_window;
GtkWidget *statbar;
guint statbar_ctx_id;
};

extern struct perf_gtk_context *pgctx;
Expand Down

0 comments on commit 14749d0

Please sign in to comment.