From affc65a5a402534527c4d4fbc5b381b5b1283445 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 28 Jun 2014 16:37:55 -0400 Subject: 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. --- window.go | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'window.go') diff --git a/window.go b/window.go index b348ae8..57283f2 100644 --- a/window.go +++ b/window.go @@ -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. -- cgit v1.2.3