aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2009-10-22 17:06:07 -0400
committerBrian Cully <github.20.shmit@spamgourmet.com>2009-10-22 17:06:21 -0400
commitc3cfc61725255a1feb1bcb76be214b1dab15eb5d (patch)
tree6c21cdd64fec9eb3b327a28bc489b08fc0d0a8c0
parent4f728be46b39caa908a1000b6f903fc4c4cb5ef4 (diff)
downloadmoxie-c3cfc61725255a1feb1bcb76be214b1dab15eb5d.tar.gz
moxie-c3cfc61725255a1feb1bcb76be214b1dab15eb5d.zip
Update for 10.6
-rw-r--r--PreferencesController.m13
-rw-r--r--ScrollingTextView.h2
-rw-r--r--WorldStatusController.m5
3 files changed, 11 insertions, 9 deletions
diff --git a/PreferencesController.m b/PreferencesController.m
index 1852adb..cba6241 100644
--- a/PreferencesController.m
+++ b/PreferencesController.m
@@ -55,18 +55,17 @@
- (IBAction)removeStartupWorld: (id)sender
{
- NSEnumerator *rowEnum;
+ NSIndexSet *selectedIndexes;
NSMutableArray *newStartupItems;
- NSNumber *row;
- int removedRows;
+ __block int removedRows;
newStartupItems = [[[NSUserDefaults standardUserDefaults] startupWorlds] mutableCopy];
removedRows = 0;
- rowEnum = [theStartupItemsTableView selectedRowEnumerator];
- while ((row = [rowEnum nextObject]) != nil) {
- [newStartupItems removeObjectAtIndex: [row intValue]-removedRows];
+ selectedIndexes = [theStartupItemsTableView selectedRowIndexes];
+ [selectedIndexes enumerateIndexesUsingBlock: ^(NSUInteger idx, BOOL *stop) {
+ [newStartupItems removeObjectAtIndex: idx-removedRows];
removedRows++;
- }
+ }];
[[NSUserDefaults standardUserDefaults] setStartupWorlds: newStartupItems];
[self refreshStartupTableView];
}
diff --git a/ScrollingTextView.h b/ScrollingTextView.h
index b917bff..2dbab1a 100644
--- a/ScrollingTextView.h
+++ b/ScrollingTextView.h
@@ -2,7 +2,7 @@
#import <Cocoa/Cocoa.h>
-@interface ScrollingTextView : NSTextView
+@interface ScrollingTextView : NSTextView <NSLayoutManagerDelegate>
{
IBOutlet NSResponder *theResponder;
}
diff --git a/WorldStatusController.m b/WorldStatusController.m
index f931055..3fd9dfb 100644
--- a/WorldStatusController.m
+++ b/WorldStatusController.m
@@ -137,12 +137,15 @@ objectValueForTableColumn: (NSTableColumn *)aTableColumn
- (void)selectWorld: (World *)aWorld
{
NSArray *worlds;
+ NSIndexSet *rowIndexes;
int row;
if (aWorld) {
worlds = [[NSDocumentController sharedDocumentController] documents];
row = [worlds indexOfObject: aWorld];
- [theTableView selectRow: row byExtendingSelection: NO];
+ rowIndexes = [NSIndexSet indexSetWithIndex: row];
+ [theTableView selectRowIndexes: rowIndexes
+ byExtendingSelection: NO];
} else
[theTableView deselectAll: self];
}