diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-17 21:09:03 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-17 21:09:03 -0400 |
| commit | 64d5eb541eb28e1a7e81adca66a72155d16033b4 (patch) | |
| tree | 7db7c7ee787afc02823833340c3a2d0068807117 /sysdata.go | |
| parent | c1807033733654db480e782acebdccda9eababc6 (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.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 { |
