summaryrefslogtreecommitdiff
path: root/window.go
diff options
context:
space:
mode:
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))