Browse Source

implement deletePage method

PHP-GTK3
yggverse 4 months ago
parent
commit
dd21e45144
  1. 24
      src/Entity/Browser/Container/Tab.php

24
src/Entity/Browser/Container/Tab.php

@ -72,7 +72,9 @@ class Tab @@ -72,7 +72,9 @@ class Tab
?\GtkWidget $child,
int $page_num
) {
// @TODO
$this->deletePage(
$page_num
);
}
);
@ -149,4 +151,24 @@ class Tab @@ -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…
Cancel
Save