Skip to content

Add frameless window tutorial #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions tutorials/basic_frameless_window/basic_frameless_window.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package main

import (
"time"

"github.com/miketheprogrammer/go-thrust/thrust"
"github.com/miketheprogrammer/go-thrust/tutorials/provisioner"
)

func main() {

thrust.InitLogger()
// Set any Custom Provisioners before Start
thrust.SetProvisioner(tutorial.NewTutorialProvisioner())
// thrust.Start() must always come before any bindings are created.
thrust.Start()

thrustWindow := thrust.NewWindow(thrust.WindowOptions{
RootUrl: "http://breach.cc/",
HasFrame: true,
})
thrustWindow.Show()
thrustWindow.Focus()

// Lets do a window timeout
go func() {
<-time.After(time.Second * 5)
thrustWindow.Close()
thrust.Exit()
}()

// In lieu of something like an http server, we need to lock this thread
// in order to keep it open, and keep the process running.
// Dont worry we use runtime.Gosched :)
thrust.LockThread()
}