From c0c38ac8f5ded52f0db925ca7ca4bc6efedcb648 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 7 Jul 2014 15:30:55 -0400 Subject: Added the GTK+ implementation of Window, added the Window constructors, and rewrote the GTK+ Button constructor to use Requests. --- redo/window.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'redo/window.go') 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) +} -- cgit v1.2.3