summaryrefslogtreecommitdiff
path: root/redo/window.go
diff options
context:
space:
mode:
Diffstat (limited to 'redo/window.go')
-rw-r--r--redo/window.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/redo/window.go b/redo/window.go
index 6debe1f..176239b 100644
--- a/redo/window.go
+++ b/redo/window.go
@@ -31,3 +31,16 @@ type Window interface {
// TODO SetSize (TODO remove?)
// TODO Center
}
+
+// NewWindow returns a Request to create a new Window with the given title text and size.
+func NewWindow(title string, width int, height int) *Request {
+ return newWindow(title, width, height)
+}
+
+// GetNewWindow is like NewWindow but sends the Request along the given Doer and returns the resultant Window.
+// Example:
+// w := ui.GetNewWindow(ui.Do, "Main Window")
+func GetNewWindow(c Doer, title string, width int, height int) Window {
+ c <- newWindow(title, width, height)
+ return (<-c.resp).(Window)
+}