MCPcopy
hub / github.com/go-qml/qml / Wait

Method Wait

qml.go:901–912  ·  view source on GitHub ↗

Wait blocks the current goroutine until the window is closed.

()

Source from the content-addressed store, hash-verified

899
900// Wait blocks the current goroutine until the window is closed.
901func (win *Window) Wait() {
902 // XXX Test this.
903 var m sync.Mutex
904 m.Lock()
905 RunMain(func() {
906 // TODO Must be able to wait for the same Window from multiple goroutines.
907 // TODO If the window is not visible, must return immediately.
908 waitingWindows[win.addr] = &m
909 C.windowConnectHidden(win.addr)
910 })
911 m.Lock()
912}
913
914var waitingWindows = make(map[unsafe.Pointer]*sync.Mutex)
915

Callers 15

runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80

Calls 1

RunMainFunction · 0.85

Tested by 1

TestRefFunction · 0.64