Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janet-lang/webview
Janet bindings to https://github.com/zserge/webview
https://github.com/janet-lang/webview
Last synced: 3 months ago
JSON representation
Janet bindings to https://github.com/zserge/webview
- Host: GitHub
- URL: https://github.com/janet-lang/webview
- Owner: janet-lang
- License: mit
- Created: 2019-01-09T04:04:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-06T10:40:59.000Z (5 months ago)
- Last Synced: 2024-06-06T12:08:15.691Z (5 months ago)
- Language: C
- Size: 35.2 KB
- Stars: 35
- Watchers: 5
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-janet - webview - like (GUI / Graphics)
README
# webview
[Janet](https://janet-lang.org) bindings to the [webview](https://github.com/zserge/webview) project.
Use an embedded browser view to build UI with minimal dependencies.## Building
To build, one must have janet installed on their system.
So far, these bindings have only been tested on linux, but should work on macos and
windows with some debugging.Use the build.janet script to build the file `webview.so` on macos and linux, and `webview.dll`
on windows.```
jpm build
```## Testing
Run a sample application that opens Hacker News with
```
jpm test
```## API
The API pretty closely matches the C API for webview. See the C api for more information.
### `(webview/init & options)`
Create a new webview handle. The options are:
- :title - string
- :width - integer
- :height - integer
- :url - string
- :debug - boolean
- :resizable - boolean### `(webview/loop handle [,blocking])`
Process on event in a loop. Typical usage looks like
```
(while (webview/loop my-handle) nil)
```### `(webview/set-title handle title)`
Set the title of the webview.
### `(webview/exit handle)`
Closes the window.
### `(webview/terminate handle)`
Exists the webview loop.
### `(webview/debug str)`
Prints a string to the appropriate debug console.
### `(webview/eval handle javascript)`
Evaluate some JavaScript inside the webview browser.