mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
implement deletePage method
This commit is contained in:
parent
61a492c6c9
commit
dd21e45144
1 changed files with 23 additions and 1 deletions
|
|
@ -72,7 +72,9 @@ class Tab
|
|||
?\GtkWidget $child,
|
||||
int $page_num
|
||||
) {
|
||||
// @TODO
|
||||
$this->deletePage(
|
||||
$page_num
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -149,4 +151,24 @@ class Tab
|
|||
|
||||
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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue