Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/php-gtk/gtk
PHP GTK Binding
https://github.com/php-gtk/gtk
c cli ffi gtk php php81
Last synced: 4 months ago
JSON representation
PHP GTK Binding
- Host: GitHub
- URL: https://github.com/php-gtk/gtk
- Owner: PHP-GTK
- License: mit
- Created: 2022-02-15T06:12:25.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T01:56:51.000Z (about 2 years ago)
- Last Synced: 2024-10-12T12:42:39.580Z (4 months ago)
- Topics: c, cli, ffi, gtk, php, php81
- Language: C
- Homepage:
- Size: 224 KB
- Stars: 19
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Requirement
- php (8.1)
- ext-FFI
- gtk-4**Installation**
```bash
composer require pgtk/gtk
```
**Example:**![alt text](img/win.png "Window")
```php
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:
- [TomatoGtk](https://github.com/kmaestro/tomate-gtk)Contributing
------------Feel free to open issues and make PR. Contributions are welcome.