>From 12e3d9eb7e83fb1d0a0f1bed394ff556b0cbe4b9 Mon Sep 17 00:00:00 2001
From: Kevin LaCoste <[email protected]>
Date: Sun, 14 Mar 2010 14:20:24 +0900
Subject: [PATCH 1/2] Make the Preferences window a panel.

This enables the standard behaviour of dismissing the panel with the <esc>
key.
---
 DBPrefsWindowController.m |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/DBPrefsWindowController.m b/DBPrefsWindowController.m
index 3988a99..64a13c6 100644
--- a/DBPrefsWindowController.m
+++ b/DBPrefsWindowController.m
@@ -74,13 +74,13 @@ - (void)windowDidLoad
         // Create a new window to display the preference views.
         // If the developer attached a window to this controller
         // in Interface Builder, it gets replaced with this one.
-    NSWindow *window = [[[NSWindow alloc]
initWithContentRect:NSMakeRect(0,0,1000,1000)
+    NSPanel *panel = [[[NSPanel alloc]
initWithContentRect:NSMakeRect(0,0,1000,1000)

styleMask:(NSTitledWindowMask |

NSClosableWindowMask |

NSMiniaturizableWindowMask)

backing:NSBackingStoreBuffered
                                                         defer:YES]
autorelease];
-    [self setWindow:window];
+    [self setWindow:panel];
     contentSubview = [[[NSView alloc] initWithFrame:[[[self window]
contentView] frame]] autorelease];
     [contentSubview setAutoresizingMask:(NSViewMinYMargin |
NSViewWidthSizable)];
     [[[self window] contentView] addSubview:contentSubview];
-- 
1.6.4.4

Reply via email to