February 2019
Intermediate to advanced
450 pages
11h 59m
English
Now let's write some code! First of all, create a new directory to put this code into—due to the way that Walk binaries are created (see the following code), we need to build at a directory level, rather with than single files, so it's good to have a clean workspace. Copy the following code into a file named hello.go:
package mainimport ( "github.com/lxn/walk" . "github.com/lxn/walk/declarative")func main() { MainWindow{ Title: "Hello", Layout: VBox{}, Children: []Widget{ Label{Text: "Hello World!"}, PushButton{ Text: "Quit", OnClicked: func() { walk.App().Exit(0) }, }, }, }.Run()}
In the preceding code, you can see two different imports for Walk—we will talk about that more later. Inside the main() function, we set up a simple window ...
Read now
Unlock full access