Add link to the examples from the sixtyfps-viewer README

This commit is contained in:
Olivier Goffart 2021-10-21 18:00:17 +02:00
parent 8fec471785
commit f8c00b19b5
2 changed files with 8 additions and 3 deletions

View file

@ -1,6 +1,6 @@
# SixtyFPS Bash example
This shows how to use `sixtyfps-viewer` to display dialog from a bash script.
This shows how to use [`sixtyfps-viewer`](../../tools/viewer) to display dialog from a bash script.
This assume that the `sixtyfps-viewer` tool is in patch. This can be achieved with cargo install.
(use the `--path tools/viewer` option to install it from the current repository.)

View file

@ -41,14 +41,14 @@ Example: Imagine we have a myfile.60 looking like this:
```60
MyApp := Window {
callback open-url(string)
callback open-url(string);
//...
}
```
It is possible to make the `open-url` callback to execute a command by doing
```
```bash
sixtyfps-viewer --on open-url 'xdg-open $1' myfile.60
```
@ -73,3 +73,8 @@ The program returns with the following error code:
- If a Dialog is closed with the "Ok" or "Closed" or "Yes" button, the exit code will be *0*
- If a Dialog is closed with the "Cancel" or "No" button, or using the close button in the window
title bar, the exit code will be *1*
## Examples
`sixtyfps-viewer` can be used to display an GUI from a shell script.
We have [a few examples](https://github.com/sixtyfpsui/sixtyfps/tree/master/examples/bash)