summaryrefslogtreecommitdiff
path: root/window.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-03 11:04:07 -0400
committerPietro Gagliardi <[email protected]>2014-07-03 11:04:07 -0400
commit1238936a16170757104879d9593ba9440c70e8cd (patch)
treeeade2af3e7602a986dd7144032c72a18f59c9825 /window.go
parentf7dedc8cb05960134234f242042a4f00d88aaf9e (diff)
Added Post() and implemented it on Windows.
Diffstat (limited to 'window.go')
-rw-r--r--window.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/window.go b/window.go
index d8375d3..99ffedf 100644
--- a/window.go
+++ b/window.go
@@ -15,6 +15,11 @@ type Window struct {
// If Closing is nil, a default which rejects the close will be used.
Closing func() bool
+ // Posted is called when Post() is called with the given Window as an argument.
+ // It receives the data passed to Post() as an argument.
+ // If Posted is nil, a default handler which does nothing will be used.
+ Posted func(data interface{})
+
created bool
sysData *sysData
initTitle string
@@ -87,6 +92,10 @@ func (w *Window) Create(control Control) {
return false
}
}
+ w.sysData.post = w.Posted
+ if w.sysData.post == nil {
+ w.sysData.post = func(data interface{}) {}
+ }
err := w.sysData.make(nil)
if err != nil {
panic(fmt.Errorf("error opening window: %v", err))