implement deletePage method

This commit is contained in:
yggverse 2024-07-12 17:34:20 +03:00
parent 61a492c6c9
commit dd21e45144

View file

@ -72,7 +72,9 @@ class Tab
?\GtkWidget $child, ?\GtkWidget $child,
int $page_num int $page_num
) { ) {
// @TODO $this->deletePage(
$page_num
);
} }
); );
@ -149,4 +151,24 @@ class Tab
return $this->_page[$page_num]; return $this->_page[$page_num];
} }
public function deletePage(
int $page_num
): void
{
if (empty($this->_page[$page_num]))
{
throw new \Exception;
}
// Free memory
$this->_page[$page_num] = null;
// Remove internal record
unset(
$this->_page[$page_num]
);
// Reorder @TODO
}
} }