dtylman / Gowd
Licence: mit
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
Stars: ✭ 309
Labels
Projects that are alternatives of or similar to Gowd
Aegys-Acesso-Remoto
Aegys Suporte Remoto é um projeto Open Source de acesso remoto multiplataforma
Stars: ✭ 32 (-89.64%)
Mutual labels: desktop
Arcgis Osm Editor
ArcGIS Editor for OpenStreetMap is a toolset for GIS users to access and contribute to OpenStreetMap through their Desktop or Server environment.
Stars: ✭ 281 (-9.06%)
Mutual labels: desktop
Desktop Dimmer
Enable darker-than-dark dimming for internal and external screens.
Stars: ✭ 290 (-6.15%)
Mutual labels: desktop
15 Minute Apps
15 minute (small) desktop apps built with PyQt
Stars: ✭ 3,086 (+898.71%)
Mutual labels: desktop
Bunqdesktop
The unofficial, free and open source desktop application for the bunq API
Stars: ✭ 271 (-12.3%)
Mutual labels: desktop
Deepkit Ml
The collaborative real-time open-source machine learning devtool and training suite: Experiment execution, tracking, and debugging. With server and project management tools.
Stars: ✭ 286 (-7.44%)
Mutual labels: desktop
Mirage
A fancy, customizable, keyboard-operable Qt/QML & Python Matrix chat client for encrypted and decentralized communication.
Stars: ✭ 257 (-16.83%)
Mutual labels: desktop
Ipfs Desktop
An unobtrusive and user-friendly desktop application for IPFS on Windows, Mac and Linux.
Stars: ✭ 3,710 (+1100.65%)
Mutual labels: desktop
Winforms
Windows Forms is a .NET UI framework for building Windows desktop applications.
Stars: ✭ 3,301 (+968.28%)
Mutual labels: desktop
Zonote
Cross-platform desktop note-taking app. Sticky notes with Markdown and Tabs. All in one .txt file.
Stars: ✭ 255 (-17.48%)
Mutual labels: desktop
Electronplayer
An Electron Based Web Video Services Player. Supporting Netflix, Youtube, Twitch, Floatplane, Hulu And More
Stars: ✭ 292 (-5.5%)
Mutual labels: desktop
Pancake
Lightweight, Fast, Easy-to-use HTML5 2D game framework!
Stars: ✭ 79 (-74.43%)
Mutual labels: desktop
Desktopdeployr
A framework for deploying self-contained R-based applications to the desktop
Stars: ✭ 282 (-8.74%)
Mutual labels: desktop
Tachiweb Server
A port of the Tachiyomi manga reader to the desktop and server
Stars: ✭ 303 (-1.94%)
Mutual labels: desktop
Element Desktop
A glossy Matrix collaboration client for desktop.
Stars: ✭ 290 (-6.15%)
Mutual labels: desktop
Fynedesk
A full desktop environment for Linux/Unix using Fyne
Stars: ✭ 286 (-7.44%)
Mutual labels: desktop
gowd
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
How to use this library:
- Download and install nwjs
- Install this library
go get github.com/dtylman/gowd
- Clone this repo.
- Place
package.json
,index.html
,main.go
andmain.js
from template in a new folder. go build
- Edit
main.js
and setgoBinary
to your your executable name:var goBinary = "./template"; //or template.exe
- Run
nw .
, the hello world template should appear:
Usage
Simplest "hello world":
import "github.com/dtylman/gowd"
func main() {
body, err := gowd.ParseElement("<h1>Hello world</h1>", nil)
if err != nil {
panic(err)
}
gowd.Run(body)
}
Adding a button:
import (
"github.com/dtylman/gowd"
)
func main() {
body, err := gowd.ParseElement("<h1>Hello world</h1>", nil)
if err != nil {
panic(err)
}
p := body.AddElement(gowd.NewElement("p"))
btn := p.AddElement(gowd.NewElement("button"))
btn.SetText("Click me")
btn.OnEvent(gowd.OnClick, btnClicked)
gowd.Run(body)
}
func btnClicked(sender *gowd.Element, event *gowd.EventElement) {
sender.SetText("Clicked!")
}
Creating and binding from HTML:
import (
"github.com/dtylman/gowd"
"fmt"
)
func main() {
body, err := gowd.ParseElement("<h1>Hello world</h1>", nil)
if err != nil {
panic(err)
}
p := body.AddElement(gowd.NewElement("p"))
em := gowd.NewElementMap()
p.AddHtml(`<select id="select1">
<option value="" disabled="disabled" selected="selected">Please select a name</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>`, em)
em["select1"].OnEvent(gowd.OnChange, btnClicked)
em["select1"].Object = body
gowd.Run(body)
}
func btnClicked(sender *gowd.Element, event *gowd.EventElement) {
body := sender.Object.(*gowd.Element)
body.AddElement(gowd.NewStyledText(fmt.Sprintf("Selected %s", event.GetValue()), gowd.BoldText))
body.AddElement(gowd.NewElement("br"))
}
Using bootstrap:
'gowd' supports creating bootstrap elements using the bootstrap package.
First, add bootsrap css and js to your index.html
file:
<script type="text/javascript" src="js/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
Then you can create bootsrap items:
import (
"github.com/dtylman/gowd"
"github.com/dtylman/gowd/bootstrap"
"time"
"fmt"
)
var body *gowd.Element
func main() {
//creates a new bootstrap fluid container
body = bootstrap.NewContainer(false)
// add some elements using the object model
div := bootstrap.NewElement("div", "well")
row := bootstrap.NewRow(bootstrap.NewColumn(bootstrap.ColumnLarge, 6, div))
body.AddElement(row)
// add some other elements from HTML
div.AddHTML(`<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example
<span class="caret"></span></button>
<ul class="dropdown-menu" id="dropdown-menu">
<li><a >HTML</a></li>
<li><a >CSS</a></li>
<li><a >JavaScript</a></li>
</ul>
</div>`, nil)
// add a button to show a progress bar
btn := bootstrap.NewButton(bootstrap.ButtonPrimary, "Start")
btn.OnEvent(gowd.OnClick, btnClicked)
row.AddElement(bootstrap.NewColumn(bootstrap.ColumnLarge, 4, bootstrap.NewElement("div", "well", btn)))
//start the ui loop
gowd.Run(body)
}
// happens when the 'start' button is clicked
func btnClicked(sender *gowd.Element, event *gowd.EventElement) {
// adds a text and progress bar to the body
text := body.AddElement(gowd.NewStyledText("Working...", gowd.BoldText))
progressBar := bootstrap.NewProgressBar()
body.AddElement(progressBar.Element)
// makes the body stop responding to user events
body.Disable()
// clean up - remove the added elements
defer func() {
body.RemoveElement(text)
body.RemoveElement(progressBar.Element)
body.Enable()
}()
// render the progress bar
for i := 0; i <= 123; i++ {
progressBar.SetValue(i, 123)
text.SetText(fmt.Sprintf("Working %v", i))
time.Sleep(time.Millisecond * 20)
// this will cause the body to be refreshed
body.Render()
}
}
This will yield the following app:
More a more advanced usage, see the Todo sample
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].