Implemented Window.Center() on Mac OS X.
This commit is contained in:
parent
a7747b95a4
commit
8632d0c2f3
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue