[go-nuts] Re: [ANN] Cross-platform HTML/CSS GUI library

2017-10-25 Thread Serge Zaitsev
Thanks for the feedback!

You know when the app is terminated because that's when the main loop ends 
(e.g. Loop() returns false, or Run() just returns). So you can write any 
code after webview.Run() and it will be executed when user presses close 
button.

App icon is something on my list. Currently, app icon can be set on Windows 
and Mac without any code (using .rc file or app bundle .icns file).
I also plan to make a function to set window icon for Gtk and Windows in 
runtime. So yes, it's definitely a high-priority. Webview apps should look 
like normal apps for the end user.

Menus on the other hand is definitely something important to have, but it 
is likely to bring a lot of code for all three platforms, and the API is 
likely to get more complex.
I think one day I will add that, too, but at the moment I can't promise 
much. Hopefully, tray menu can also be implemented by reusing most of the 
code.

On Wednesday, October 25, 2017 at 4:51:37 PM UTC+3, Ain wrote:
>
>
> On Wednesday, October 25, 2017 at 3:39:42 PM UTC+3, Serge Zaitsev wrote:
>>
>> Hey all,
>>
>> I made a tiny library that provides a cross-platform web UI for Go apps.
>>
>> https://github.com/zserge/webview
>>
>
> Looks intresting, thanks for making it available!
>  
>  
>
>>  
>>
> Apart from the app architecture, I wonder what features do you think this 
>> library lacks for your needs, or what could be done better.
>> Any ideas, feedback or critique are welcome.
>>
>
> Of the top of my head:
>  - callback when app is terminated (via the [x] button on titlebar);
>  - ability to create native menu for the main wnd;
>  - ability to set app icon.
>
>
> ain
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] [ANN] Cross-platform HTML/CSS GUI library

2017-10-25 Thread Serge Zaitsev
Hey all,

I made a tiny library that provides a cross-platform web UI for Go apps.

https://github.com/zserge/webview

No dependencies on Windows and Mac. Gtk-Webkit is only required on Linux 
and OpenBSD.
Resulting binaries are much smaller and less resource-hungry comparing to 
Electron.
Supported browser engines are modern enough to let developers use 
HTML5/CSS3 without any quirks (on Windows IE10-IE11 are used).

I tried to keep Go API very simple, and the whole library is very concise, 
too.

JavaScript<->Go bindings are provided to let core app communicate with the 
UI.

I haven't thought much about how to architect such apps, but to me the 
reactive approach works really well (something similar to redux). I keep 
app state in Go as a structure, pass it as JSON to the UI and incrementally 
update the UI (using picodom.js).
Also, in response to UI actions I send a JSON describing the action and its 
parameters to Go where I handle it and update the state.
You may look at an example 
here: https://github.com/zserge/webview/tree/master/examples/todo-go

Apart from the app architecture, I wonder what features do you think this 
library lacks for your needs, or what could be done better.
Any ideas, feedback or critique are welcome.

Thanks!
Serge

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.