Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191081
b: refs/heads/master
c: 7081e08
h: refs/heads/master
i:
  191079: 188a8eb
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Mar 12, 2010
1 parent 5756b33 commit e051dd3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 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: f9224c5c944b60cf709db4adf1f5195264b8d194
refs/heads/master: 7081e087b90d4eb4348f7970bd6b266d837321ef
23 changes: 19 additions & 4 deletions trunk/tools/perf/util/newt.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,30 @@

#include <stdlib.h>
#include <newt.h>
#include <sys/ttydefaults.h>

#include "cache.h"
#include "hist.h"
#include "session.h"
#include "sort.h"
#include "symbol.h"

static void newt_form__set_exit_keys(newtComponent self)
{
newtFormAddHotKey(self, NEWT_KEY_ESCAPE);
newtFormAddHotKey(self, 'Q');
newtFormAddHotKey(self, 'q');
newtFormAddHotKey(self, CTRL('c'));
}

static newtComponent newt_form__new(void)
{
newtComponent self = newtForm(NULL, NULL, 0);
if (self)
newt_form__set_exit_keys(self);
return self;
}

static size_t hist_entry__append_browser(struct hist_entry *self,
newtComponent listbox, u64 total)
{
Expand Down Expand Up @@ -77,8 +94,7 @@ static void hist_entry__annotate_browser(struct hist_entry *self)
newtListboxSetWidth(listbox, max_line_len);

newtCenteredWindow(max_line_len + 2, ws.ws_row - 5, self->sym->name);
form = newtForm(NULL, NULL, 0);
newtFormAddHotKey(form, NEWT_KEY_ESCAPE);
form = newt_form__new();
newtFormAddComponents(form, listbox, NULL);

newtFormRun(form, &es);
Expand Down Expand Up @@ -108,8 +124,7 @@ void perf_session__browse_hists(struct rb_root *hists, u64 session_total,

get_term_dimensions(&ws);

form = newtForm(NULL, NULL, 0);
newtFormAddHotKey(form, NEWT_KEY_ESCAPE);
form = newt_form__new();

listbox = newtListbox(1, 1, ws.ws_row - 2, (NEWT_FLAG_SCROLL |
NEWT_FLAG_BORDER |
Expand Down

0 comments on commit e051dd3

Please sign in to comment.