• 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
NSSegmentedControl, Modal Window problems and Sheets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSegmentedControl, Modal Window problems and Sheets


  • Subject: NSSegmentedControl, Modal Window problems and Sheets
  • From: Andrew Skinner <email@hidden>
  • Date: Thu, 2 Dec 2004 15:15:20 +0000

I'm a bit of a newbie and I'm hoping that someone may be able to help me with this interface problem.

I have created a NSSegmentedControl in a view subclass as a single section set with a graphic to represent a button.

When the button is pressed I want to show a sheet. However when i click the segment to launch the sheet I get the error:

2004-12-02 12:21:17.807 teleport[14767] *** Assertion failure in -[NSApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate: didEndSelector:contextInfo:], AppKit.subproj/NSApplication.m:2763
2004-12-02 12:21:17.811 teleport[14767] Modal session requires modal window


I have read a stack of posts relating to this in the list archives and have searched Google as far as I can to no avail.

Here are the details:

1. Everything is running in the main Application window.
2. I am calling the sheet with this code:

[segControl setAction:@selector(openSheet:)];

and the function called is:

- (IBAction)openSheet:(id)sender
{
[NSApp beginSheet: theSheet
modalForWindow: mainWindow
modalDelegate: self
didEndSelector: @selector(sheetDidEnd: returnCode: contextInfo:)
contextInfo: nil];
}


3. Main window is an outlet connected to the main window in IB, I have tried setting the modalForWindow attribute to all sorts but nothing seems to work.

4. All of this code is contained in the view subclass that I have created to display the segmented control.

5. I have instantiated the view class in IB and made the connections.

6. if I use the same code with a standard button everything works fine.

7. I tried a standard alert panel and it displys but is not connected to the window so i am sure i am referencing the main window incorrectly.

8. I know that the action is being called correctly from the NSSegmentedControl as I get a readout from NSLog tests

It's driving me mad so if anyone can help i'd be eternally grateful.

Fingers crossed,

a

_______________________________________________
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: [SOLVED] Re: Totally confused: NSObject not init'ing
  • Next by Date: Re: NSTimer won't fire.
  • Previous by thread: Fwd: Re: NSPanel and stopModal - how to focus on the main window again?
  • Next by thread: Event loop
  • Index(es):
    • Date
    • Thread