• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Drawing problems after modal window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing problems after modal window


  • Subject: Drawing problems after modal window
  • From: Paul Collins <email@hidden>
  • Date: Tue, 12 Jul 2005 10:19:45 -0700

My app puts up an modal evaluation window at launch unless a serial number has been entered. Intermittently, when this window has appeared, after it is dismissed, other windows display drawing bugs:

1. The main window has a bindings master-detail interface. The detail includes an NSMatrix of radio buttons. When selecting items with different values for the NSMatrix, or clicking one of the radio buttons, sometimes one of the unselected buttons disappears (including its title). The NSMatris is bound through the selectedTag option. We have seen this on Panther but not on Tiger.

2. A second modal window (a setup assistant) sometimes erases its contents, except for the default button, as soon as it appears. Removing the Return key shortcut from the button allows it to draw correctl at first, but other drawing anomalies appear.


Am I doing something wrong with my initial modal window? Here's what I do:


-applicationDidFinishLaunching: starts a brief NSThread. An observer is set on "NSThreadWillExitNotification". The notification- called method does this:

[self performSelectorOnMainThread:@selector (reallyFinishLaunching:) withObject:[iMaker valueForKey:@"iRtnMsg"] waitUntilDone:NO];

Then...

- (void)reallyFinishLaunching:(NSString *)aRtnMsg {
    ...
    if (serialNumberNotPresent) {
        MyEvalController *cont = [[MyEvalController alloc] init];
        okToContinue = [cont showSplash];
        [cont release];
    }
    ...

// Conditionally, the second modal window, mentioned in (2) above, runs

    ...

[iMainWind makeKeyAndOrderFront:self]; // Show main window with the master-detail views

}

In MyEvalController.mm:

- (BOOL)showSplash {
BOOL mayContinue = NO;
MySerialDialog *dialogger = [[MySerialDialog alloc] init]; // loads nib file


    rtn = [dialogger runEvalDialogWithTitle:dtitle body:dbody];
    if (rtn == NSRunAbortedResponse) {
        mayContinue = YES;
    } else if (rtn == kODSUninstallResponse) {
        [[NSApp delegate] uninstallAction:self];
    } // if NSRunStoppedResponse (OK), just quit
    return mayContinue;
}

@implementation ODSerialDialog

// this init loads nib
- (id)init {
    if (self = [super init]) {
        if (![NSBundle loadNibNamed:@"ODSerialDialog" owner:self]) {
             // loadNibNamed sets Outlets including "evalPanel" below
            [self release];
            return nil;
        }
    }
    return self;
}

- (int)runEvalDialogWithTitle:(NSString *)titleStr body:(NSString *) bodyStr {
int rtn;


    [title setStringValue:titleStr];
    [body setStringValue:bodyStr];
    rtn = [NSApp runModalForWindow:evalPanel]; // an NSPanel in nib
    // AFTER THE DIALOG
    [evalPanel close];
    return rtn; // pass response code to caller to deal with
}

See anything wrong with that?

Thanks,

Paul Collins


** Gracion Software LLC http://www.gracion.com/ ** ** Tel: +1 (541) 488-3488 iChat/AV/AIM: gracionsoft ** ** DigiTunnel 1.4 PPTP/VPN client for OS X ** ** Pronto Patent - search/download US patents fast ** ** And check out: http://www.opendoor.com/envision/ **

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: nil properties in Fetch Requests
  • Next by Date: Re: IB Binding no error, Programmatic Binding error
  • Previous by thread: Re: Finding out mouse button state outside of event stream
  • Next by thread: get/set full keyboard access
  • Index(es):
    • Date
    • Thread