diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-03 11:04:07 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-03 11:04:07 -0400 |
| commit | 1238936a16170757104879d9593ba9440c70e8cd (patch) | |
| tree | eade2af3e7602a986dd7144032c72a18f59c9825 /window.go | |
| parent | f7dedc8cb05960134234f242042a4f00d88aaf9e (diff) | |
Added Post() and implemented it on Windows.
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)) |
