PHP-GTK / gtk

PHP GTK Binding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

PHP GTK Binding

License:MIT License


Languages

Language:C 94.3%Language:PHP 5.7%