use tool parent menu for debug item

This commit is contained in:
yggverse 2024-07-30 21:19:39 +03:00
parent cb4c86bdac
commit f124f20660
4 changed files with 73 additions and 15 deletions

View file

@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Menu;
use \GtkMenu;
use \GtkMenuItem;
use \Yggverse\Yoda\Entity\Browser\Menu;
class Tool
{
// GTK
public GtkMenuItem $gtk;
// Dependencies
public Menu $menu;
// Requirements
public Tool\Debug $debug;
// Defaults
public const LABEL = 'Tool';
public function __construct(
Menu $menu
) {
// Init dependencies
$this->menu = $menu;
// Init menu item
$this->gtk = GtkMenuItem::new_with_label(
$this::LABEL
);
// Init submenu container
$tool = new GtkMenu;
// Init debug menu item
$this->debug = new Tool\Debug(
$this
);
$tool->append(
$this->debug->gtk
);
$this->gtk->set_submenu(
$tool
);
// Render
$this->gtk->show();
}
}