diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-08-10 15:44:20 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-08-10 15:44:20 -0300 |
commit | 59e8fe32fc0cc9dff6b0c269d099a49e004dc45e (patch) | |
tree | 55133961ebcbf9ea5b5ab674360207876c189349 /tools/perf/util/ui/browsers/map.c | |
parent | f1e9214cc99644101d957c5c660946c6f2f86d7c (diff) | |
download | blackbird-op-linux-59e8fe32fc0cc9dff6b0c269d099a49e004dc45e.tar.gz blackbird-op-linux-59e8fe32fc0cc9dff6b0c269d099a49e004dc45e.zip |
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>
Diffstat (limited to 'tools/perf/util/ui/browsers/map.c')
-rw-r--r-- | tools/perf/util/ui/browsers/map.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/perf/util/ui/browsers/map.c b/tools/perf/util/ui/browsers/map.c index b79f0c996ea8..142b825b42bf 100644 --- a/tools/perf/util/ui/browsers/map.c +++ b/tools/perf/util/ui/browsers/map.c @@ -100,11 +100,11 @@ static int map_browser__search(struct map_browser *self) static int map_browser__run(struct map_browser *self, struct newtExitStruct *es) { - if (ui_browser__show(&self->b, self->map->dso->long_name) < 0) + if (ui_browser__show(&self->b, self->map->dso->long_name, + "Press <- or ESC to exit, %s / to search", + verbose ? "" : "restart with -v to use") < 0) return -1; - ui_helpline__fpush("Press <- or ESC to exit, %s / to search", - verbose ? "" : "restart with -v to use"); newtFormAddHotKey(self->b.form, NEWT_KEY_LEFT); newtFormAddHotKey(self->b.form, NEWT_KEY_ENTER); if (verbose) @@ -121,9 +121,7 @@ static int map_browser__run(struct map_browser *self, struct newtExitStruct *es) break; } - newtFormDestroy(self->b.form); - newtPopWindow(); - ui_helpline__pop(); + ui_browser__hide(&self->b); return 0; } |