Added comment explaining the use of -[NSWindow setContentSize:] in Mac OS X sysData.setWindowSize().

This commit is contained in:
Pietro Gagliardi 2014-05-01 13:13:10 -04:00
parent 3af89507ca
commit 61b3b03418
1 changed files with 1 additions and 0 deletions

View File

@ -519,6 +519,7 @@ func (s *sysData) setWindowSize(width int, height int) error {
ret := make(chan struct{}) ret := make(chan struct{})
defer close(ret) defer close(ret)
uitask <- func() { uitask <- func() {
// use -[NSWindow setContentSize:], which will resize the window without taking the titlebar as part of the given size and without needing us to consider the window's position (the function takes care of both for us)
C.objc_msgSend_size(s.id, _setContentSize, C.objc_msgSend_size(s.id, _setContentSize,
C.int64_t(width), C.int64_t(height)) C.int64_t(width), C.int64_t(height))
C.objc_msgSend_noargs(s.id, _display) // TODO needed? C.objc_msgSend_noargs(s.id, _display) // TODO needed?