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>
diff --git a/tools/perf/util/ui/browsers/annotate.c b/tools/perf/util/ui/browsers/annotate.c
index 73e78ef..55ff792 100644
--- a/tools/perf/util/ui/browsers/annotate.c
+++ b/tools/perf/util/ui/browsers/annotate.c
@@ -141,10 +141,10 @@
 	struct rb_node *nd;
 	struct hist_entry *he = self->b.priv;
 
-	if (ui_browser__show(&self->b, he->ms.sym->name) < 0)
+	if (ui_browser__show(&self->b, he->ms.sym->name,
+			     "<- or ESC: exit, TAB/shift+TAB: cycle thru samples") < 0)
 		return -1;
 
-	ui_helpline__fpush("<- or ESC: exit, TAB/shift+TAB: cycle thru samples");
 	newtFormAddHotKey(self->b.form, NEWT_KEY_LEFT);
 
 	nd = self->curr_hot;
@@ -177,9 +177,7 @@
 		}
 	}
 out:
-	newtFormDestroy(self->b.form);
-	newtPopWindow();
-	ui_helpline__pop();
+	ui_browser__hide(&self->b);
 	return 0;
 }