diff options
Diffstat (limited to 'window.go')
| -rw-r--r-- | window.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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)) |
