pgtk/gtk

Maintainers

Details

github.com/PHP-GTK/gtk

Source

Issues

Installs: 37

Dependents: 0

Suggesters: 0

Security: 0

Stars: 19

Watchers: 3

Forks: 4

Open Issues: 0

Language:C

0.1.1 2022-11-16 15:32 UTC

This package is auto-updated.

Last update: 2024-04-25 04:46:52 UTC


README

Requirement

  • php (8.1)
  • ext-FFI
  • gtk-4

Installation

composer require pgtk/gtk

Example:

alt text

require_once __DIR__ . '/vendor/autoload.php';

use PGtk\Gtk\Gtk\Window;
use PGtk\Gtk\Gtk\HeaderBar;
use PGtk\Gtk\Gtk\Label;
use PGtk\Gtk\GLib\MainLoop;

$run = true;

$window = new Window();
$window->widget->setSizeRequest(100, 100);
$window->setTitle('Window');

$headerBar = new HeaderBar();
$headerBar->setDecorationLayout('menu:close');
$window->setTitlebar($headerBar);

$label = new Label('label');

$window->setChild($label);

$loop = new MainLoop();
$window->connect('destroy', function (Window $window, MainLoop $loop) {
    $loop->quit();
}, $loop);

$window->widget->show();

$loop->run();

Supported platforms and features

Platforms

Platform Status
Linux
Windows

Examples:

Contributing

Feel free to open issues and make PR. Contributions are welcome.