Wait blocks the current goroutine until the window is closed.
()
| 899 | |
| 900 | // Wait blocks the current goroutine until the window is closed. |
| 901 | func (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 | |
| 914 | var waitingWindows = make(map[unsafe.Pointer]*sync.Mutex) |
| 915 |