FROM : Roberto Arias
DATE : Thu Apr 14 17:11:39 2005
Im trying to display a login/passwd sheet (animated), after my main
window is loaded.
This is the code used to load the login nib and display it (took it
from Apple Documentation ;-)
if (!login_panel) {
[NSBundle loadNibNamed: @"login.nib" owner:self];
}
[NSApp beginSheet: login_panel
modalForWindow: [NSApp mainWindow]
modalDelegate: nil
didEndSelector: nil
contextInfo: nil];
[NSApp runModalForWindow: login_panel];
[NSApp endSheet: login_panel];
[login_panel orderOut: self];
It worked well when I tested it with a button (I pressed the button ->
the sheet showed up... animated). However, when I moved the code to
the delegate method (from NSApplication):
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
The sheet pops up in a non-animated fashion.
I tried the delegate from NSWindow:
- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow
*)sheet usingRect:(NSRect)rect
But again, the sheet just comes animated when I use the test button,
and not when I launch the application. Does anyone know how to work
around this?
DATE : Thu Apr 14 17:11:39 2005
Im trying to display a login/passwd sheet (animated), after my main
window is loaded.
This is the code used to load the login nib and display it (took it
from Apple Documentation ;-)
if (!login_panel) {
[NSBundle loadNibNamed: @"login.nib" owner:self];
}
[NSApp beginSheet: login_panel
modalForWindow: [NSApp mainWindow]
modalDelegate: nil
didEndSelector: nil
contextInfo: nil];
[NSApp runModalForWindow: login_panel];
[NSApp endSheet: login_panel];
[login_panel orderOut: self];
It worked well when I tested it with a button (I pressed the button ->
the sheet showed up... animated). However, when I moved the code to
the delegate method (from NSApplication):
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
The sheet pops up in a non-animated fashion.
I tried the delegate from NSWindow:
- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow
*)sheet usingRect:(NSRect)rect
But again, the sheet just comes animated when I use the test button,
and not when I launch the application. Does anyone know how to work
around this?
| Related mails | Author | Date |
|---|---|---|
| No related mails found. | ||






Cocoa mail archive

