diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-18 22:45:40 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-18 22:45:40 -0400 |
| commit | f131ac432bceb9129bf62af88cdf6e301e85a488 (patch) | |
| tree | 000e05fcdff3f5c79db12448ffa3154e5cd24a14 /redo/window_windows.go | |
| parent | e0e52ad83457c5c7ad9afd4ae124be68c47333a6 (diff) | |
Implemented the beginning of a potential solution to the Windows modality issue.
Diffstat (limited to 'redo/window_windows.go')
| -rw-r--r-- | redo/window_windows.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/redo/window_windows.go b/redo/window_windows.go index 60f89d1..5789df8 100644 --- a/redo/window_windows.go +++ b/redo/window_windows.go @@ -14,6 +14,7 @@ import "C" type window struct { hwnd C.HWND shownbefore bool + modallevel int closing *event @@ -99,3 +100,21 @@ func windowClosing(data unsafe.Pointer) { C.windowClose(w.hwnd) } } + +//export windowBeginModal +func windowBeginModal(data unsafe.Pointer) { + w := (*window)(data) + C.EnableWindow(w.hwnd, C.FALSE) + w.modallevel++ +} + +//export windowEndModal +func windowEndModal(data unsafe.Pointer) { + w := (*window)(data) + w.modallevel-- + if w.modallevel == 0 { + C.EnableWindow(w.hwnd, C.TRUE) + } else if w.modallevel < 0 { + panic("window begin/end modal mismatch") + } +} |
