2021-10-06 08:36:28 -05:00
|
|
|
package gui
|
|
|
|
|
2021-10-06 10:43:58 -05:00
|
|
|
import (
|
|
|
|
"log"
|
2021-10-06 08:36:28 -05:00
|
|
|
|
2021-10-06 10:43:58 -05:00
|
|
|
"github.com/andlabs/ui"
|
|
|
|
_ "github.com/andlabs/ui/winmanifest"
|
|
|
|
)
|
2021-10-06 08:36:28 -05:00
|
|
|
|
|
|
|
func Main(f func()) {
|
|
|
|
log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
|
|
|
|
ui.Main(f)
|
|
|
|
}
|
|
|
|
|
2021-10-25 09:07:23 -05:00
|
|
|
// Other goroutines must use this to access the GUI
|
2021-10-06 08:36:28 -05:00
|
|
|
//
|
|
|
|
// You can not acess / process the GUI thread directly from
|
2021-10-06 10:43:58 -05:00
|
|
|
// other goroutines. This is due to the nature of how
|
2021-10-06 08:36:28 -05:00
|
|
|
// Linux, MacOS and Windows work (they all work differently. suprise. surprise.)
|
|
|
|
// For example: gui.Queue(addNewTabForColorSelection())
|
|
|
|
func Queue(f func()) {
|
|
|
|
log.Println("Sending function to gui.Main() (using gtk via andlabs/ui)")
|
|
|
|
ui.QueueMain(f)
|
|
|
|
}
|
|
|
|
|
2021-10-25 09:07:23 -05:00
|
|
|
/*
|
2021-10-06 10:43:58 -05:00
|
|
|
func ExampleWindow() {
|
|
|
|
log.Println("START gui.ExampleWindow()")
|
2021-10-06 08:36:28 -05:00
|
|
|
|
2021-10-25 08:07:46 -05:00
|
|
|
Config.Title = "ExampleWindow"
|
|
|
|
node := NewWindow()
|
2021-10-09 19:25:52 -05:00
|
|
|
node.AddDebugTab("jcarr Debug")
|
2021-10-06 08:36:28 -05:00
|
|
|
}
|
2021-10-25 09:07:23 -05:00
|
|
|
*/
|