Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: my preferences sheet appears under XCode not under the app ...




On 2-Sep-07, at 11:51 AM, Yvon Thoraval wrote:

when it is the first run of my app, i force the app to open the preferences
sheet like that :


  def awakeFromNib()
    puts "@isFirstRun = #{@isFirstRun}"
    if @isFirstRun
      @prefs = Preferences.new
      showPreferences( @mainWindow )
      @prefs.save
    end
[...]



The trick about awakeFromNib is that it is called just before the window is shown. This is very useful as it allows you to change aspects of the window's content before it is shown. However it means that you can't attach a sheet to the window, as you can't attach a sheet to a window that is not visible.


On a side note, I don't think that a preferences window should never be displayed as a sheet as there usually is no reason why it should block the user from using the main window.

Cheers, Patrick
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >my preferences sheet appears under XCode not under the app ... (From: "Yvon Thoraval" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.