Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234472
b: refs/heads/master
c: b210b3b
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Feb 25, 2011
1 parent f16f1fc commit 9c69474
Show file tree
Hide file tree
Showing 3 changed files with 18 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: c16bfe9ac389b13a37ff617a09682ecc0685960f
refs/heads/master: b210b3bb1b002f27165325a5edb6ebce3c168e92
18 changes: 15 additions & 3 deletions trunk/tools/perf/util/ui/browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,20 @@ void ui_browser__add_exit_keys(struct ui_browser *self, int keys[])
}
}

void __ui_browser__show_title(struct ui_browser *browser, const char *title)
{
SLsmg_gotorc(0, 0);
ui_browser__set_color(browser, NEWT_COLORSET_ROOT);
slsmg_write_nstring(title, browser->width);
}

void ui_browser__show_title(struct ui_browser *browser, const char *title)
{
pthread_mutex_lock(&ui__lock);
__ui_browser__show_title(browser, title);
pthread_mutex_unlock(&ui__lock);
}

int ui_browser__show(struct ui_browser *self, const char *title,
const char *helpline, ...)
{
Expand All @@ -180,9 +194,7 @@ int ui_browser__show(struct ui_browser *self, const char *title,
return -1;

pthread_mutex_lock(&ui__lock);
SLsmg_gotorc(0, 0);
ui_browser__set_color(self, NEWT_COLORSET_ROOT);
slsmg_write_nstring(title, self->width);
__ui_browser__show_title(self, title);

ui_browser__add_exit_keys(self, keys);
newtFormAddComponent(self->form, self->sb);
Expand Down
3 changes: 2 additions & 1 deletion trunk/tools/perf/util/ui/browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct ui_browser {
u32 nr_entries;
};


void ui_browser__set_color(struct ui_browser *self, int color);
void ui_browser__set_percent_color(struct ui_browser *self,
double percent, bool current);
Expand All @@ -35,6 +34,8 @@ void ui_browser__reset_index(struct ui_browser *self);
void ui_browser__gotorc(struct ui_browser *self, int y, int x);
void ui_browser__add_exit_key(struct ui_browser *self, int key);
void ui_browser__add_exit_keys(struct ui_browser *self, int keys[]);
void __ui_browser__show_title(struct ui_browser *browser, const char *title);
void ui_browser__show_title(struct ui_browser *browser, const char *title);
int ui_browser__show(struct ui_browser *self, const char *title,
const char *helpline, ...);
void ui_browser__hide(struct ui_browser *self);
Expand Down

0 comments on commit 9c69474

Please sign in to comment.