summaryrefslogtreecommitdiff
path: root/sysdata.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-17 21:09:03 -0400
committerPietro Gagliardi <[email protected]>2014-03-17 21:09:03 -0400
commit64d5eb541eb28e1a7e81adca66a72155d16033b4 (patch)
tree7db7c7ee787afc02823833340c3a2d0068807117 /sysdata.go
parentc1807033733654db480e782acebdccda9eababc6 (diff)
Changed the new resizing code so that it uses the same allocated slice per window instead of making a new one to store all the resize requests each time.
Diffstat (limited to 'sysdata.go')
-rw-r--r--sysdata.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdata.go b/sysdata.go
index cdf6a14..c010ab6 100644
--- a/sysdata.go
+++ b/sysdata.go
@@ -17,7 +17,8 @@ func newEvent() chan struct{} {
type cSysData struct {
ctype int
event chan struct{}
- resize func(x int, y int, width int, height int) []resizerequest
+ resize func(x int, y int, width int, height int, rr *[]resizerequest)
+ resizes []resizerequest
alternate bool // editable for Combobox, multi-select for listbox, password for lineedit
handler AreaHandler // for Areas
}
@@ -103,11 +104,15 @@ const (
)
func mksysdata(ctype int) *sysData {
- return &sysData{
+ s := &sysData{
cSysData: cSysData{
ctype: ctype,
},
}
+ if ctype == c_window { // make resizes non-nil so it can be passed in
+ s.resizes = make([]resizerequest, 0, 0)
+ }
+ return s
}
type resizerequest struct {