diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-28 16:37:55 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-28 16:37:55 -0400 |
| commit | affc65a5a402534527c4d4fbc5b381b5b1283445 (patch) | |
| tree | ef34e20694a809577b2d609d9e3ffadfe64bbc12 /window.go | |
| parent | 02d6a03ba3a657aa7b50d072771361236bb207a3 (diff) | |
Fixed the build. New API works on Windows! Also removed TODO on dialogs in Windows since I can't reproduce the weird behavior anymore; I guess the new code fixes it.
Diffstat (limited to 'window.go')
| -rw-r--r-- | window.go | 20 |
1 files changed, 8 insertions, 12 deletions
@@ -88,20 +88,15 @@ func (w *Window) SetSpaced(spaced bool) { // Open creates the Window with Create and then shows the Window with Show. As with Create, you cannot call Open more than once per window. func (w *Window) Open(control Control) { - done := make(chan struct{}) - defer close(done) - touitask(func() { - w.Create(control) - w.Show() - done <- struct{}{} - }) - <-done + w.create(control, true) } // Create creates the Window, setting its control to the given control. It does not show the window. This can only be called once per window, and finalizes all initialization of the control. func (w *Window) Create(control Control) { - done := make(chan struct{}) - defer close(done) + w.create(control, false) +} + +func (w *Window) create(control Control, show bool) { touitask(func() { if w.created { panic("window already open") @@ -128,9 +123,10 @@ func (w *Window) Create(control Control) { } w.sysData.setText(w.initTitle) w.created = true - done <- struct{}{} + if show { + w.Show() + } }) - <-done } // Show shows the window. |
