diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-30 11:19:13 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-30 11:19:13 -0400 |
| commit | 08dfb5da2034c33b68d7247dd16925960b3b88a3 (patch) | |
| tree | 054e95178635037bfdc8d78959a4f2bb957fab9c /sysdata_darwin.go | |
| parent | f2d6daa9ea2203a897ee3af77105273531622aaf (diff) | |
Attempted to add the Area bare bones and resizing code to the Mac OS X backend. It complains that initWithFrame: is not implemented...
Diffstat (limited to 'sysdata_darwin.go')
| -rw-r--r-- | sysdata_darwin.go | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/sysdata_darwin.go b/sysdata_darwin.go index 5b2f126..b3ee48d 100644 --- a/sysdata_darwin.go +++ b/sysdata_darwin.go @@ -20,6 +20,7 @@ type sysData struct { type classData struct { make func(parentWindow C.id, alternate bool) C.id + getinside func(scrollview C.id) C.id show func(what C.id) hide func(what C.id) settextsel C.SEL @@ -269,6 +270,12 @@ var classTypes = [nctypes]*classData{ show: controlShow, hide: controlHide, }, + c_area: &classData{ + make: makeArea, + getinside: areaInScrollView, + show: controlShow, + hide: controlHide, + }, } // I need to access sysData from appDelegate, but appDelegate doesn't store any data. So, this. @@ -308,7 +315,14 @@ func (s *sysData) make(initText string, window *sysData) error { } s.id = <-ret s.setText(initText) - addSysData(s.id, s) + if ct.getinside != nil { + uitask <- func() { + ret <- ct.getinside(s.id) + } + addSysData(<-ret, s) + } else { + addSysData(s.id, s) + } return nil } @@ -483,3 +497,17 @@ func (s *sysData) len() int { } return <-ret } + +func (s *sysData) setAreaSize(width int, height int) { + ret := make(chan struct{}) + defer close(ret) + uitask <- func() { + area := areaInScrollView(s.id) +println(C.GoString(C.object_getClassName(area))) + objc_msgSend_rect_bool(area, _setFrameDisplay, + int(0), int(0), width, height, + C.BOOL(C.YES)) // redraw + ret <- struct{}{} + } + <-ret +} |
