pgtk / gtk
0.1.1
2022-11-16 15:32 UTC
Requires
- php: ^8.1
- ext-ffi: *
Requires (Dev)
- phpunit/phpunit: 9.*
This package is auto-updated.
Last update: 2024-09-25 05:53:31 UTC
README
需求
- php (8.1)
- ext-FFI
- gtk-4
安装
composer require pgtk/gtk
示例
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();
支持的平台和功能
平台
示例
贡献
请随意提交问题并创建PR。欢迎贡献。