FROM : Tod Cunningham
DATE : Mon Nov 22 18:36:49 2004
I also found an example that suggested the following:
[[NSRunLoop currentRunLoop]
performSelector:@selector(editCabrilloHeadersForWindow:)
target:self
argument:[windowController
window]
order:0
modes:[NSArray
arrayWithObject:NSDefaultRunLoopMode]];
Is it recommend that I go through the runloop or should I just
performSelector on itself with a delay of 0?
On Nov 22, 2004, at 2:19 AM, Shaun Wexler wrote:
> On Nov 21, 2004, at 9:50 PM, Tod Cunningham wrote:
>
>> I would like to have a sheet auto open when a new document is created
>> in an NSDocument project. Where is the best place to put the call to
>> beginSheet? I have tried several places and none seem to work. Most
>> interestingly the following doesn't work:
>>
>> - (void)windowControllerDidLoadNib:(NSWindowController *)
>> windowController
>> {
>> ...
>>
>> if( some_condition_that_requires_sheet_to_be_auto_opened )
>> {
>> [NSApp beginSheet:cabrilloHeaderPanel
>> modalForWindow:[windowController window]
>> modalDelegate:self
>>
>> didEndSelector:@selector(editCabrilloHeadersDidEnd:returnCode:
>> contextInfo:)
>> contextInfo:nil];
>> }
>> }
>>
>> What happens is that the sheet gets opened, but not attached to the
>> window (looks very odd as the sheet will have to title bar). The
>> sheet opens before the window is visible and ends up detached. Any
>> ideas on how to approach this?
>
> - (void)windowControllerDidLoadNib:(NSWindowController *)
> windowController
> {
> ...
>
> if( some_condition_that_requires_sheet_to_be_auto_opened )
> {
> [self performSelector:@selector(openCHPSheet:)
> withObject:[windowController window] afterDelay:0.0];
> }
> }
>
> - (void)openCabrilloHeaderPanelSheetInWindow:(NSWindow *)window
> {
> [NSApp beginSheet:cabrilloHeaderPanel
> modalForWindow:window
> modalDelegate:self
>
> didEndSelector:@selector(editCabrilloHeadersDidEnd:returnCode:
> contextInfo:)
> contextInfo:nil];
> }
> --
> Shaun Wexler
> MacFOH
> http://www.macfoh.com
>
DATE : Mon Nov 22 18:36:49 2004
I also found an example that suggested the following:
[[NSRunLoop currentRunLoop]
performSelector:@selector(editCabrilloHeadersForWindow:)
target:self
argument:[windowController
window]
order:0
modes:[NSArray
arrayWithObject:NSDefaultRunLoopMode]];
Is it recommend that I go through the runloop or should I just
performSelector on itself with a delay of 0?
On Nov 22, 2004, at 2:19 AM, Shaun Wexler wrote:
> On Nov 21, 2004, at 9:50 PM, Tod Cunningham wrote:
>
>> I would like to have a sheet auto open when a new document is created
>> in an NSDocument project. Where is the best place to put the call to
>> beginSheet? I have tried several places and none seem to work. Most
>> interestingly the following doesn't work:
>>
>> - (void)windowControllerDidLoadNib:(NSWindowController *)
>> windowController
>> {
>> ...
>>
>> if( some_condition_that_requires_sheet_to_be_auto_opened )
>> {
>> [NSApp beginSheet:cabrilloHeaderPanel
>> modalForWindow:[windowController window]
>> modalDelegate:self
>>
>> didEndSelector:@selector(editCabrilloHeadersDidEnd:returnCode:
>> contextInfo:)
>> contextInfo:nil];
>> }
>> }
>>
>> What happens is that the sheet gets opened, but not attached to the
>> window (looks very odd as the sheet will have to title bar). The
>> sheet opens before the window is visible and ends up detached. Any
>> ideas on how to approach this?
>
> - (void)windowControllerDidLoadNib:(NSWindowController *)
> windowController
> {
> ...
>
> if( some_condition_that_requires_sheet_to_be_auto_opened )
> {
> [self performSelector:@selector(openCHPSheet:)
> withObject:[windowController window] afterDelay:0.0];
> }
> }
>
> - (void)openCabrilloHeaderPanelSheetInWindow:(NSWindow *)window
> {
> [NSApp beginSheet:cabrilloHeaderPanel
> modalForWindow:window
> modalDelegate:self
>
> didEndSelector:@selector(editCabrilloHeadersDidEnd:returnCode:
> contextInfo:)
> contextInfo:nil];
> }
> --
> Shaun Wexler
> MacFOH
> http://www.macfoh.com
>
| Related mails | Author | Date |
|---|---|---|
| Tod Cunningham | Nov 22, 06:50 | |
| Shaun Wexler | Nov 22, 08:19 | |
| Tod Cunningham | Nov 22, 18:36 |






Cocoa mail archive

