+SubTask**
+menuitem_to_subtasklist(MenuItem** menuitem_list, int list_length)
+{
+ SubTask** new_subtasklist;
+
+ new_subtasklist = malloc(list_length*sizeof(SubTask*));
+
+ for (int i = 0; i < list_length; i++) {
+ SubTask* cur_subtask;
+ SubTask* new_subtask;
+
+ cur_subtask = (SubTask*)get_menuitem_userdata(menuitem_list[i]);
+ new_subtask = malloc(sizeof(SubTask));
+
+ new_subtask->subtask_name = strdup(cur_subtask->subtask_name);
+ new_subtask->done = cur_subtask->done;
+
+ new_subtasklist[i] = new_subtask;
+ }
+
+ /* new_subtasklist[list_length] = 0; */
+
+ return new_subtasklist;
+}
+
+