Skip to content

Commit 5513ab3

Browse files
Merge pull request #56 from tsu-ku-ne/frameless
Add frameless window tutorial
2 parents a9a9ad5 + 812bbb4 commit 5513ab3

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package main
2+
3+
import (
4+
"time"
5+
6+
"github.com/miketheprogrammer/go-thrust/thrust"
7+
"github.com/miketheprogrammer/go-thrust/tutorials/provisioner"
8+
)
9+
10+
func main() {
11+
12+
thrust.InitLogger()
13+
// Set any Custom Provisioners before Start
14+
thrust.SetProvisioner(tutorial.NewTutorialProvisioner())
15+
// thrust.Start() must always come before any bindings are created.
16+
thrust.Start()
17+
18+
thrustWindow := thrust.NewWindow(thrust.WindowOptions{
19+
RootUrl: "http://breach.cc/",
20+
HasFrame: true,
21+
})
22+
thrustWindow.Show()
23+
thrustWindow.Focus()
24+
25+
// Lets do a window timeout
26+
go func() {
27+
<-time.After(time.Second * 5)
28+
thrustWindow.Close()
29+
thrust.Exit()
30+
}()
31+
32+
// In lieu of something like an http server, we need to lock this thread
33+
// in order to keep it open, and keep the process running.
34+
// Dont worry we use runtime.Gosched :)
35+
thrust.LockThread()
36+
}

0 commit comments

Comments
 (0)