summaryrefslogtreecommitdiff
path: root/redo/window.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-07 15:30:55 -0400
committerPietro Gagliardi <[email protected]>2014-07-07 15:30:55 -0400
commitc0c38ac8f5ded52f0db925ca7ca4bc6efedcb648 (patch)
treedfd26c04614de99081742446f422559fc9d3f289 /redo/window.go
parent7966d7023015ba3ec5e0ed3c3e5682651b5b33fb (diff)
Added the GTK+ implementation of Window, added the Window constructors, and rewrote the GTK+ Button constructor to use Requests.
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)
+}