mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Changes in object model: separate class objects to store vtable. Also, nicer UTF-8 display of big numbers.
This commit is contained in:
@ -61,15 +61,21 @@ static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) {
|
||||
return result;
|
||||
}
|
||||
|
||||
PanelClass DisplayOptionsPanel_class = {
|
||||
.super = {
|
||||
.extends = Class(Panel),
|
||||
.delete = DisplayOptionsPanel_delete
|
||||
},
|
||||
.eventHandler = DisplayOptionsPanel_eventHandler
|
||||
};
|
||||
|
||||
DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr) {
|
||||
DisplayOptionsPanel* this = (DisplayOptionsPanel*) malloc(sizeof(DisplayOptionsPanel));
|
||||
DisplayOptionsPanel* this = AllocThis(DisplayOptionsPanel);
|
||||
Panel* super = (Panel*) this;
|
||||
Panel_init(super, 1, 1, 1, 1, CHECKITEM_CLASS, true);
|
||||
((Object*)this)->delete = DisplayOptionsPanel_delete;
|
||||
Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true);
|
||||
|
||||
this->settings = settings;
|
||||
this->scr = scr;
|
||||
super->eventHandler = DisplayOptionsPanel_eventHandler;
|
||||
|
||||
Panel_setHeader(super, "Display options");
|
||||
Panel_add(super, (Object*) CheckItem_new(strdup("Tree view"), &(settings->pl->treeView), false));
|
||||
|
Reference in New Issue
Block a user