aboutsummaryrefslogtreecommitdiff
path: root/AppKit
diff options
context:
space:
mode:
Diffstat (limited to 'AppKit')
-rw-r--r--AppKit/GTMWindowSheetController.h7
-rw-r--r--AppKit/GTMWindowSheetController.m3
2 files changed, 8 insertions, 2 deletions
diff --git a/AppKit/GTMWindowSheetController.h b/AppKit/GTMWindowSheetController.h
index 558814e..7991112 100644
--- a/AppKit/GTMWindowSheetController.h
+++ b/AppKit/GTMWindowSheetController.h
@@ -74,8 +74,11 @@
delegate:(id <GTMWindowSheetControllerDelegate>)delegate;
// Starts a view modal session for a sheet. Intentionally similar to
-// -[NSApplication beginSheet:modalForWindow:modalDelegate:didEndSelector:
-// contextInfo:].
+// -[NSApplication
+// beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:].
+// You must only call this method if the currently active view is |view| or
+// |nil|; this means you can call this method only after creating the
+// GTMWindowSheetController or after calling -setActiveView:view.
//
// Args:
// sheet: The window object representing the sheet you want to
diff --git a/AppKit/GTMWindowSheetController.m b/AppKit/GTMWindowSheetController.m
index bf85e59..92e2526 100644
--- a/AppKit/GTMWindowSheetController.m
+++ b/AppKit/GTMWindowSheetController.m
@@ -339,6 +339,9 @@ willPositionSheet:(NSWindow*)sheet
}
[invocation invokeWithTarget:systemSheet];
+ _GTMDevAssert(!activeView_ || activeView_ == view,
+ @"You have to call setActiveView:view before "
+ "calling beginSheet:modalForView:view");
activeView_ = view;
}