diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-01-28 04:09:06 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-17 15:30:15 -0200 |
commit | 187a035a769fb490318091fee2b0051d9b188ad5 (patch) | |
tree | ad74fe0bfe51adb320f2f2bbb8ce45fcd335f960 /ListItem.c | |
parent | ece89b8df0db61b8caaf53679afbe00e1c2ef22f (diff) |
Add support for multiple screens, switchable using Tab
Diffstat (limited to 'ListItem.c')
-rw-r--r-- | ListItem.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -27,13 +27,13 @@ typedef struct ListItem_ { }*/ -static void ListItem_delete(Object* cast) { +void ListItem_delete(Object* cast) { ListItem* this = (ListItem*)cast; free(this->value); free(this); } -static void ListItem_display(Object* cast, RichString* out) { +void ListItem_display(Object* cast, RichString* out) { ListItem* const this = (ListItem*)cast; assert (this != NULL); /* @@ -59,11 +59,15 @@ ObjectClass ListItem_class = { .compare = ListItem_compare }; -ListItem* ListItem_new(const char* value, int key) { - ListItem* this = AllocThis(ListItem); +void ListItem_init(ListItem* this, const char* value, int key) { this->value = xStrdup(value); this->key = key; this->moving = false; +} + +ListItem* ListItem_new(const char* value, int key) { + ListItem* this = AllocThis(ListItem); + ListItem_init(this, value, key); return this; } |