Implemented Window.Center() on Mac OS X.

This commit is contained in:
Pietro Gagliardi 2014-06-11 11:17:00 -04:00
parent a7747b95a4
commit 8632d0c2f3
3 changed files with 16 additions and 0 deletions

View File

@ -116,6 +116,7 @@ extern BOOL isCheckboxChecked(id);
extern void windowSetContentSize(id, intptr_t, intptr_t);
extern void setProgress(id, intptr_t);
extern void setAreaSize(id, intptr_t, intptr_t);
extern void center(id);
/* combobox_darwin.m */
extern id makeCombobox(BOOL);

View File

@ -412,3 +412,13 @@ func (s *sysData) repaintAll() {
}
<-ret
}
func (s *sysData) center() {
ret := make(chan struct{})
defer close(ret)
uitask <- func() {
C.center(s.id)
ret <- struct{}{}
}
<-ret
}

View File

@ -229,3 +229,8 @@ void setAreaSize(id scrollview, intptr_t width, intptr_t height)
[area setFrame:NSMakeRect(0, 0, (CGFloat) width, (CGFloat) height)];
[area display]; // and redraw
}
void center(id w)
{
[toNSWindow(w) center];
}