Last active
December 23, 2015 22:09
-
-
Save snyh/6701629 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "dui" | |
import "fmt" | |
import "io/ioutil" | |
func main() { | |
dui.Init() | |
f := dui.NewFrame(300, 300) | |
content, _ := ioutil.ReadFile("/dev/shm/dui/Source/dui/test.htm") | |
f.LoadContent(string(content)) | |
e := f.Ele("snyh") | |
fmt.Printf(e.Content()) | |
var flag bool // support closure | |
f.Ele("button").SignalConnect("click", func() { | |
flag = !flag | |
if flag { | |
e.SetContent("one two three") | |
} else { | |
e.SetContent("three two one") | |
} | |
}) | |
dui.Run() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment