Giter Site home page Giter Site logo

gowd's People

Contributors

bradleyjkemp avatar chownie avatar dtylman avatar jaicewizard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gowd's Issues

Example of FileButton

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.

process exited with code -2

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.

Bundle nwjs during build for a standalone executable?

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.

Window size

Can you set the size of the window when it opens?

Strip CRLFs when parsing HTML

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.

When I try to run the todomvc code, I get "Process exited with code -4058".

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)

Cannot set text of a text area.

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!

Very confused by installation intructions

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!

<select> element on event changes to first option.

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.