diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:33 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:33 +0200 |
commit | f75ab6d2c11e8a8e18191b087564aedebbeb96c5 (patch) | |
tree | 2a046e11678e798f3f9c7f7af4f9ac205c8d2731 /ColorsPanel.c | |
parent | 2004bbc3ef28ada3acca05f5d5fa9108121a6784 (diff) | |
download | debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.tar.gz debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.tar.bz2 debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.zip |
Imported Upstream version 1.0.3upstream/1.0.3
Diffstat (limited to 'ColorsPanel.c')
-rw-r--r-- | ColorsPanel.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ColorsPanel.c b/ColorsPanel.c index bf94bf5..4e28d01 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -51,7 +51,7 @@ static void ColorsPanel_delete(Object* object) { free(this); } -static HandlerResult ColorsPanel_EventHandler(Panel* super, int ch) { +static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { ColorsPanel* this = (ColorsPanel*) super; HandlerResult result = IGNORED; @@ -83,15 +83,21 @@ static HandlerResult ColorsPanel_EventHandler(Panel* super, int ch) { return result; } +PanelClass ColorsPanel_class = { + .super = { + .extends = Class(Panel), + .delete = ColorsPanel_delete + }, + .eventHandler = ColorsPanel_eventHandler +}; + ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) { - ColorsPanel* this = (ColorsPanel*) malloc(sizeof(ColorsPanel)); + ColorsPanel* this = AllocThis(ColorsPanel); Panel* super = (Panel*) this; - Panel_init(super, 1, 1, 1, 1, CHECKITEM_CLASS, true); - ((Object*)this)->delete = ColorsPanel_delete; + Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true); this->settings = settings; this->scr = scr; - super->eventHandler = ColorsPanel_EventHandler; Panel_setHeader(super, "Colors"); for (int i = 0; ColorSchemes[i] != NULL; i++) { |