mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
refactor to separated entities, init abstractions
This commit is contained in:
parent
08c9fe76e5
commit
90acc3ac2d
47 changed files with 1927 additions and 2069 deletions
41
src/Abstract/Entity/Button.php
Normal file
41
src/Abstract/Entity/Button.php
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue