perf ui browser: Add ui_browser__show counterpart: __hide

So that the common tasks of providing a helpline at __run entry and
destroying the window and releasing resourses at exit can be abstracted
away, reducing a bit more the coupling with libnewt.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo
2010-08-10 15:44:20 -03:00
parent f1e9214cc9
commit 59e8fe32fc
7 changed files with 33 additions and 15 deletions

View File

@@ -211,7 +211,8 @@ static int hist_browser__run(struct hist_browser *self, const char *title,
nr_events, unit);
newtDrawRootText(0, 0, str);
if (ui_browser__show(&self->b, title) < 0)
if (ui_browser__show(&self->b, title,
"Press '?' for help on key bindings") < 0)
return -1;
newtFormAddHotKey(self->b.form, 'A');
@@ -253,6 +254,8 @@ static int hist_browser__run(struct hist_browser *self, const char *title,
return 0;
}
}
ui_browser__hide(&self->b);
return 0;
}