mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
init window as entity
This commit is contained in:
parent
7b38e00089
commit
183c26e56a
3 changed files with 90 additions and 64 deletions
52
src/Yoda.php
52
src/Yoda.php
|
|
@ -9,56 +9,6 @@ require_once __DIR__ .
|
|||
// Init app
|
||||
\Gtk::init();
|
||||
|
||||
$config = \Yggverse\Yoda\Model\File::getConfig(); // @TODO
|
||||
|
||||
$window = new \GtkWindow();
|
||||
|
||||
$window->set_size_request(
|
||||
$config->window->width,
|
||||
$config->window->height
|
||||
);
|
||||
|
||||
if ($config->window->header->enabled)
|
||||
{
|
||||
$header = new \GtkHeaderBar();
|
||||
|
||||
$header->set_title(
|
||||
$config->window->title
|
||||
);
|
||||
|
||||
$header->set_show_close_button(
|
||||
$config->window->header->button->close
|
||||
);
|
||||
|
||||
$window->set_titlebar(
|
||||
$header
|
||||
);
|
||||
}
|
||||
|
||||
$window->connect(
|
||||
'destroy',
|
||||
function()
|
||||
{
|
||||
\Gtk::main_quit();
|
||||
}
|
||||
);
|
||||
|
||||
$page = new \Yggverse\Yoda\Tab\Page();
|
||||
|
||||
$page->open(
|
||||
'yoda://welcome'
|
||||
);
|
||||
|
||||
$tab = new \GtkNotebook();
|
||||
|
||||
$tab->add(
|
||||
$page->box
|
||||
);
|
||||
|
||||
$window->add(
|
||||
$tab
|
||||
);
|
||||
|
||||
$window->show_all();
|
||||
new \Yggverse\Yoda\Entity\Window();
|
||||
|
||||
\Gtk::main();
|
||||
Loading…
Add table
Add a link
Reference in a new issue