refactor to separated entities, init abstractions

This commit is contained in:
yggverse 2024-07-03 02:34:14 +03:00
parent 08c9fe76e5
commit 90acc3ac2d
47 changed files with 1927 additions and 2069 deletions

View file

@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Abstract\Entity;
abstract class Button
{
public \GtkButton $gtk;
protected bool $_sensitive = false;
protected string $_label = 'Button';
public function __construct()
{
$this->gtk = new \GtkButton;
$this->gtk->set_sensitive(
$this->_sensitive
);
$this->gtk->set_label(
$this->_label
);
$this->gtk->connect(
'clicked',
function(
\GtkButton $entity
) {
$this->_onClick(
$entity
);
}
);
}
abstract protected function _onClick(
\GtkButton $entity
): void;
}