mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
40 lines
No EOL
786 B
PHP
40 lines
No EOL
786 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Yggverse\Yoda\Entity\Browser\Menu\Tab;
|
|
|
|
class Add
|
|
{
|
|
public \GtkMenuItem $gtk;
|
|
|
|
// Dependencies
|
|
public \Yggverse\Yoda\Entity\Browser\Menu\Tab $tab;
|
|
|
|
// Defaults
|
|
private string $_label = 'Add';
|
|
|
|
public function __construct(
|
|
\Yggverse\Yoda\Entity\Browser\Menu\Tab $tab
|
|
) {
|
|
// Init dependencies
|
|
$this->tab = $tab;
|
|
|
|
// Init menu item
|
|
$this->gtk = \GtkMenuItem::new_with_label(
|
|
$this->_label
|
|
);
|
|
|
|
// Render
|
|
$this->gtk->show();
|
|
|
|
// Init events
|
|
$this->gtk->connect(
|
|
'activate',
|
|
function()
|
|
{
|
|
$this->tab->menu->browser->container->tab->appendPage();
|
|
}
|
|
);
|
|
}
|
|
} |