• 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
subclass NSAlert or what?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subclass NSAlert or what?


  • Subject: subclass NSAlert or what?
  • From: Johnny Deadman <email@hidden>
  • Date: Tue, 12 Apr 2005 01:19:36 -0400

the Apple dox for NSAlert say 'not designed for subclassing' but perhaps folks here can enlighten me as to how to solve this problem.

In the course of a user paste, I may need to throw up a dialog which tells a user that a style in what they just pasted isn't available in this document, and which of the available styles do they want to use to replace it.

The section of code looks something like this (edited for clarity):

if ( ! [[self documentStyle] doesContainElementStyleNamed: elementStyleName] )
{
GLElementStyle *replacementElementStyle =
[self userChosenReplacementElementStyleForElementStyleNamed: elementStyleName];


if ( replacementElementStyle == nil) return nil; // User aborted

// replace this elementStyle name through the string
returnString = [self replaceElementStyleName: elementStyleName
withElementStyleName: [replacementElementStyle name]
inAttributedString: returnString];
}


So I am wondering how to implement - userChosenReplacementElementStyleForElementStyleNamed:

It needs to throw up a dialog, which has a pop-up menu in it populated with alternatives, and return either the selected object or 'nil' if the user presses the 'cancel' button. Obviously I can create this in a NIB but I have no idea how to get the value the user chooses back to the controller. An NSAlert would be easy, but obviously this needs to be customized... do I have to make a windowController & all that jazz or is there a simpler way of doing it?

TIA,

JB


_______________________________________________ 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: Launched window not activating
  • Next by Date: Re: Launched window not activating
  • Previous by thread: Re: [Slightly OT] OgreKit
  • Next by thread: Re: subclass NSAlert or what?
  • Index(es):
    • Date
    • Thread