Re: duplicate help menu
Re: duplicate help menu
- Subject: Re: duplicate help menu
- From: "Oscar Bascara" <email@hidden>
- Date: Mon, 30 Jul 2007 16:42:54 -0700
On 7/30/07, Ron Fleckner <email@hidden> wrote:
>
> On 31/07/2007, at 1:02 AM, Oscar Bascara wrote:
>
> > On 7/30/07, Ron Fleckner wrote:
> >> Date: Sun, 29 Jul 2007 19:45:12 -0700
> >> From: "Oscar Bascara"
> >> Subject: duplicate help menu
> >> To: email@hidden
> >>
> >>
> >>> In awakeFromNib for a controller object, I'm displaying a modal
> >>> alert
> >>> dialog using NSRunAlertPanel(). During the dialog, there are two
> >>> menu
> >>> in the menu bar, the Application menu and the Help menu, which seems
> >>> to get automatically generated. The problem is, the rest of the
> >>> menus
> >>> are populated when the dialog closes, and I end up with two Help
> >>> menus. It would be nice to suppress the automatically generated
> >>> Help
> >>> menu at the beginning. Any idea?
> >>>
> >>> Thanks,
> >>> Oscar
> >>
> >> Hi Oscar.
> >>
> >> I'm not sure, but I think that running a modal alert from -
> >> awakeFromNib isn't such a good idea. I think the best place to do
> >> this (if you actually think it's a good thing to start your app with
> >> a modal alert) is in the app delegate method -
> >> applicationDidFinishLaunching:. You'd have to make your controller
> >> object the delegate of NSApplication, which you can do in Interface
> >> Builder.
> >>
> >> Hope that helps
> >>
> >> Ron
> >>
> >
> > I'm using the modal alert during the first run of the application to
> > show a license agreement. If the license agreement is accepted, the
> > application finishes launching. Otherwise, the application exits.
> > Also, I'm using the modal alert for a trial version message (e.g.,
> > "There are 10 days left in the trial version.").
> >
> > After moving the modal alert from awakeFromNib to
> > applicationDidFinishLaunching:, I see the application window and menu
> > bar fully launched. But I was hoping to show the modal alert before
> > all that.
> >
> > What do people use to show the license agreement or other modal alerts
> > at the very beginning of an application (before it's done launching)?
> >
> > Thanks,
> > Oscar
>
>
> OK, of course, that's logical. Sorry about the misunderstanding.
>
> I did try running NSRunAlertPanel in -awakeFromNib and noted that the
> Help menu _didn't_ appear, only the application menu. That was in a
> small sand-pit type of project I keep around for trying out things
> like that. After dismissing the alert, the rest of the menu and app
> window appeared as normal. So maybe there's something else going on?
>
> I'm on 10.4.10 PPC G4
>
Thanks, Ron. I forgot to mention that I also have a help book
specified in Info.plist using:
CFBundleHelpBookFolder
CFBundleHelpBookName
Without a help book, it runs fine. But with the help book specified,
a help menu apparently gets automatically generated during the
NSRunAlertPanel() in awakeFromNib, and I end up with two help menus.
You may have noticed a response from Paolo Manna for me to use
applicationWillFinishLaunching: (which occurs between awakeFromNib:
and applicationDidFinishLaunching). That does work! Thanks guys for
your help.
Oscar
> Good luck,
>
> Ron
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden