From a7c2aedcecd3763464e83f80bd6c4f1216f58428 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 8 Nov 2007 23:23:01 +0000 Subject: Improve construction of tree view, properly nesting threads. Add CPU affinity screen ('a' key). BUGFIX: Correct display of TPGID field. Add TGID field. --- ColorsPanel.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'ColorsPanel.c') diff --git a/ColorsPanel.c b/ColorsPanel.c index e62583cd..00868457 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -23,7 +23,6 @@ typedef struct ColorsPanel_ { Settings* settings; ScreenManager* scr; - bool check[5]; } ColorsPanel; }*/ @@ -50,10 +49,9 @@ ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) { Panel_setHeader(super, "Colors"); for (int i = 0; ColorSchemes[i] != NULL; i++) { - Panel_add(super, (Object*) CheckItem_new(String_copy(ColorSchemes[i]), &(this->check[i]))); - this->check[i] = false; + Panel_add(super, (Object*) CheckItem_new(String_copy(ColorSchemes[i]), NULL, false)); } - this->check[settings->colorScheme] = true; + CheckItem_set((CheckItem*)Panel_get(super, settings->colorScheme), true); return this; } @@ -75,10 +73,9 @@ HandlerResult ColorsPanel_EventHandler(Panel* super, int ch) { case 0x0d: case KEY_ENTER: case ' ': - for (int i = 0; ColorSchemes[i] != NULL; i++) { - this->check[i] = false; - } - this->check[mark] = true; + for (int i = 0; ColorSchemes[i] != NULL; i++) + CheckItem_set((CheckItem*)Panel_get(super, i), false); + CheckItem_set((CheckItem*)Panel_get(super, mark), true); this->settings->colorScheme = mark; result = HANDLED; } -- cgit v1.2.3