Removed the NSMakeRect(0, 0, 100, 100) dummy init rect from the Mac OS X backend; NSZeroRect works fine for this after all. Thanks to jer in irc.freenode.net/#macdev.

This commit is contained in:
Pietro Gagliardi 2014-08-05 22:02:57 -04:00
parent 46bb97cb75
commit 3dcdd05562
5 changed files with 9 additions and 11 deletions

View File

@ -58,8 +58,7 @@ id newButton(void)
{
NSButton *b;
// TODO cache the initial rect?
b = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
b = [[NSButton alloc] initWithFrame:NSZeroRect];
[b setButtonType:NSMomentaryPushInButton];
[b setBordered:YES];
[b setBezelStyle:NSRoundedBezelStyle];
@ -91,7 +90,7 @@ id newCheckbox(void)
{
NSButton *c;
c = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
c = [[NSButton alloc] initWithFrame:NSZeroRect];
[c setButtonType:NSSwitchButton];
[c setBordered:NO];
setStandardControlFont((id) c);
@ -148,7 +147,7 @@ id newTextField(void)
{
NSTextField *t;
t = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
t = [[NSTextField alloc] initWithFrame:NSZeroRect];
return finishNewTextField(t, YES);
}
@ -156,7 +155,7 @@ id newPasswordField(void)
{
NSSecureTextField *t;
t = [[NSSecureTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
t = [[NSSecureTextField alloc] initWithFrame:NSZeroRect];
return finishNewTextField(toNSTextField(t), YES);
}
@ -176,7 +175,7 @@ id newLabel(void)
{
NSTextField *l;
l = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
l = [[NSTextField alloc] initWithFrame:NSZeroRect];
[l setEditable:NO];
[l setSelectable:NO];
[l setDrawsBackground:NO];

View File

@ -34,7 +34,7 @@ id newContainerView(void *gocontainer)
{
goContainerView *c;
c = [[goContainerView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
c = [[goContainerView alloc] initWithFrame:NSZeroRect];
c->gocontainer = gocontainer;
return (id) c;
}

View File

@ -10,7 +10,7 @@ id newScrollView(id content)
{
NSScrollView *sv;
sv = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
sv = [[NSScrollView alloc] initWithFrame:NSZeroRect];
[sv setDocumentView:toNSView(content)];
[sv setHasHorizontalScroller:YES];
[sv setHasVerticalScroller:YES];

View File

@ -11,7 +11,7 @@ id newTab(void)
{
NSTabView *t;
t = [[NSTabView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
t = [[NSTabView alloc] initWithFrame:NSZeroRect];
setStandardControlFont((id) t); // safe; same selector provided by NSTabView
return (id) t;
}

View File

@ -37,8 +37,7 @@ id newTable(void)
{
NSTableView *t;
// TODO makerect
t = [[NSTableView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
t = [[NSTableView alloc] initWithFrame:NSZeroRect];
[t setAllowsColumnReordering:NO];
[t setAllowsColumnResizing:YES];
// TODO make this an option on all platforms