dtylman / gowd Goto Github PK
View Code? Open in Web Editor NEWBuild cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
License: MIT License
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
License: MIT License
Hi,
Can you give an example of how to use FileButton to receive a selected filename in gowd?
I have tried:
package main
import (
"github.com/dtylman/gowd"
"github.com/dtylman/gowd/bootstrap"
"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.ColumnSmall, 3, div))
// add a button to show a progress bar
btn := bootstrap.NewFileButton(bootstrap.ButtonPrimary, "Upload File", false)
btn.OnEvent(gowd.OnChange, btnFileUploaded)
div.AddElement(btn.Element)
body.AddElement(row)
//start the ui loop
gowd.Run(body)
}
// happens when the file is added to the FileButton above
func btnFileUploaded(sender *gowd.Element, event *gowd.EventElement) {
body.AddElement(gowd.NewStyledText(fmt.Sprintf("Selected %s", sender.GetValue()), gowd.BoldText))
body.AddElement(gowd.NewElement("br"))
}
and no filename is shown when I select a file.
I also tried:
// happens when the file is added to the FileButton above
func btnFileUploaded(sender *gowd.Element, event *gowd.EventElement) {
fileButton := sender.Object.(*bootstrap.FileButton)
body.AddElement(gowd.NewStyledText(fmt.Sprintf("Selected %s", fileButton.GetValue()), gowd.BoldText))
body.AddElement(gowd.NewElement("br"))
}
and this also failed.
I keep getting process exited with code -2 every time I run "nw .", this is just with the template as I haven't changed anything yet.
Hi, pardon my inexperience. Looks like this project requires nwjs installed to run?
I like go in that it can build self contained binaries that tend to also be small footprint. It would be nice for future enhancement to build scaffolding on top of this project such that you can bundle the nwjs requirement into the compiled go binary so that instead of
nw .
in the current path where the code is compiled, we could do ./myGoAppName
, and where we can use go build
and go install
(or some other final build process) on the scaffolding to produce a standalone self-contained binary that will run w/o installing nwjs for it is packaged in with the compiled app.
Initially this could just target the platform being built on, and later look into cross-compile support (compile once and you get binaries for *nix, Mac, Windows).
For me, w/o the self contained binary feature, I don't see that much benefit of go w/ nwjs, I could just use other language with it instead.
Can you set the size of the window when it opens?
passing line breaks in side innerHTML
param to ParseElement
causes line breaks to appear in the generated output, causing malformed UI to be passed to nwjs
.
I am also having a separate error but I understand that it is not harmful:
MINGW64 ~/go/src/github.com/dtylman/gowd/cmd/todomvc (master)
$ ~/nw/nw .
[10864:5888:0303/195421.396:ERROR:device_event_log_impl.cc(211)] [19:54:21.396] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[10864:5888:0303/195421.400:ERROR:device_event_log_impl.cc(211)] [19:54:21.400] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
I assume that because of nwjs it is for the big three : Linux, OS X and Windows.
Just looking for confirmation.
Thanks already.
Hello,
First off, I would like to say that I am glad I found this library because I really like it.
Now, my issue is that whenever I try and set the text of a textarea element using element.SetText()
, it will clear all my elements(the body). I am not sure why this happens but thought that maybe you could look into it.
Thanks!
Hey!
I want to use NW.js in my Go project, but I have absolutely no experience from installing it. I am very confused by the steps in your installation instruction. Would be great if you could write an ELI5 version of it.
Cheers!
I'm developing a GUI app on go
div = gowd.NewElement("div")
div.AddHTML(
Seleccione...100200300, b.em)
pnl.AddToBody(div)
b.em["lstEmpresas"].OnEvent(gowd.OnChange, b.onChangeLstEmpresa)
i have 3 value in a select element, when the onchange event is called works and i can get de option... But when the event finishes, the option is changed to the first option.
How i can solve this issue?
Will add a tag interface{}
for each element so users can associate arbitrary data to elements.
我用的是mac,想要给mac ,liunx 和 window 打包程序,具体该怎么操作呢,感谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.