Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
Scrabbalize - Commitdiff - ViewGit - Blue Static

Instead of setting the coordinates for the window, call [window center] in [awakeFromNib]

Robert Sesek [2008-06-05 20:23]
Instead of setting the coordinates for the window, call [window center] in [awakeFromNib]

* English.lproj/MainMenu.nib: Add an outlet for NSWindow in AppDelegate
* Source/AppController.m+h: Add an ivar for NSWindow
(awakeFromNib): New method to center window
diff --git a/English.lproj/MainMenu.nib/designable.nib b/English.lproj/MainMenu.nib/designable.nib
index 06bd694..9eb302d 100644
--- a/English.lproj/MainMenu.nib/designable.nib
+++ b/English.lproj/MainMenu.nib/designable.nib
@@ -9,7 +9,7 @@
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
 			<integer value="106"/>
-			<integer value="381"/>
+			<integer value="371"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1446,6 +1446,14 @@
 					</object>
 					<int key="connectionID">420</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBOutletConnection" key="connection">
+						<string key="label">window</string>
+						<reference key="source" ref="953132641"/>
+						<reference key="destination" ref="972006081"/>
+					</object>
+					<int key="connectionID">422</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -2504,9 +2512,9 @@
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
-					<string>{{417, 422}, {568, 356}}</string>
+					<string>{{57, 173}, {568, 356}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<string>{{417, 422}, {568, 356}}</string>
+					<string>{{57, 173}, {568, 356}}</string>
 					<reference ref="9"/>
 					<string>{{492, 421}, {568, 356}}</string>
 					<reference ref="9"/>
@@ -2582,7 +2590,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">421</int>
+			<int key="maxID">422</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -2599,12 +2607,14 @@
 						<object class="NSMutableArray" key="dict.sortedKeys">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<string>tilesField</string>
+							<string>window</string>
 							<string>wordlist</string>
 							<string>wordlistView</string>
 						</object>
 						<object class="NSMutableArray" key="dict.values">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<string>NSTextField</string>
+							<string>NSWindow</string>
 							<string>NSArrayController</string>
 							<string>NSTableView</string>
 						</object>
diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib
index 20d7dad..1e20ebe 100644
Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ
diff --git a/Source/AppController.h b/Source/AppController.h
index 8f2eebc..30a1ee5 100644
--- a/Source/AppController.h
+++ b/Source/AppController.h
@@ -24,6 +24,7 @@
 	// interface
 	IBOutlet NSTextField *tilesField;
 	IBOutlet NSTableView *wordlistView;
+	IBOutlet NSWindow *window;

 	IBOutlet NSArrayController *wordlist;
 }
diff --git a/Source/AppController.m b/Source/AppController.m
index 6a37bb4..9ccfed8 100644
--- a/Source/AppController.m
+++ b/Source/AppController.m
@@ -43,6 +43,14 @@
 }

 /**
+ * Awake from nib
+ */
+- (void)awakeFromNib
+{
+	[window center];
+}
+
+/**
  * Destructor
  */
 - (void)dealloc