You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://packagist.org/packages/clue/zenity-react)
5
5
6
6
Zenity allows you to build graphical desktop (GUI) applications in PHP, built on top of [ReactPHP](https://reactphp.org/).
@@ -61,6 +61,10 @@ Once [installed](#install), you can use the following code to open a prompt
61
61
asking the user for his name and presenting it in another info dialog.
62
62
63
63
```php
64
+
<?php
65
+
66
+
require __DIR__ . '/vendor/autoload.php';
67
+
64
68
$launcher = new Clue\React\Zenity\Launcher();
65
69
66
70
$entry = new EntryDialog();
@@ -69,10 +73,12 @@ $entry->setEntryText(getenv('USER')); // prefill with current user
69
73
70
74
$launcher->launch($entry)->then(function ($name) use ($launcher) {
71
75
$launcher->launch(new InfoDialog('Welcome to zenity-react, ' . $name .'!'));
76
+
}, function (Exception $e) {
77
+
echo 'Error: ' . $e->getMessage() . PHP_EOL;
72
78
});
73
79
```
74
80
75
-
Looking for more examples? Take a look at the [examples](examples) folder.
81
+
Looking for more examples? Take a look at the [examples](examples/) folder.
76
82
77
83
## Usage
78
84
@@ -152,6 +158,8 @@ Loop::addTimer(3.0, function () use ($zen) {
$launcher->launch($builder->confirmLicense(__DIR__ . '/../README.md', 'I have read the README.md file'))->then(function ($checked) use ($main, $launcher) {
0 commit comments