summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-07 15:03:39 -0400
committerPietro Gagliardi <[email protected]>2014-07-07 15:03:39 -0400
commit7966d7023015ba3ec5e0ed3c3e5682651b5b33fb (patch)
treea55e801a21b720ed50ab6317bcfc0be4de9092c6
parenta7715d01d7a52c2ac7ce4fd486c1b838fb35bd8f (diff)
Added Window to the redo.
-rw-r--r--redo/window.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/redo/window.go b/redo/window.go
new file mode 100644
index 0000000..6debe1f
--- /dev/null
+++ b/redo/window.go
@@ -0,0 +1,33 @@
+// 7 july 2014
+
+package ui
+
+// Window represents a top-level window on screen that contains other Controls.
+// Windows in package ui can only contain one control; the Stack and Grid layout Controls allow you to pack multiple Controls in a Window.
+// Note that a Window is not itself a Control.
+type Window interface {
+ // SetControl creates a Request to the Window's child Control.
+ SetControl(c Control) *Request
+
+ // Title and SetTitle create Requests to get and set the Window's title, respectively.
+ Title() *Request
+ SetTitle(title string) *Request
+
+ // Show and Hide create Requests to bring the Window on-screen and off-screen, respectively.
+ Show() *Request
+ Hide() *Request
+
+ // Close creates a Request to close the Window.
+ // Any Controls within the Window are destroyed, and the Window itself is also destroyed.
+ // Attempting to use a Window after it has been closed results in undefined behavior.
+ Close() *Request
+
+ // OnClosing registers an event handler that is triggered when the user clicks the Window's close button.
+ // On systems where whole applications own windows, OnClosing is also triggered when the user asks to close the application.
+ // If this handler returns true, the Window is closed as defined by Close above.
+ // If this handler returns false, the Window is not closed.
+ OnClosing(func(c Doer) bool)
+
+ // TODO SetSize (TODO remove?)
+ // TODO Center
+}