Are sheets broken in Leopard or I am doing something very wrong?

  • I am trying to display custom sheet upon displaying new window in
    Cocoa document based app.
    The problem is that sheet is not displayed as sheet but as normal
    standalone window!? As far as I remember
    the method I'm using worked perfectly in Tiger. What am I doing wrong?

    Please find ripped code at: http://galeb.etf.bg.ac.yu/~toptan/iPGWizard.zip

    Thanks.

    Toplica
  • On Jan 12, 2008, at 3:08 PM, Toplica Tanasković wrote:

    > I am trying to display custom sheet upon displaying new window in
    > Cocoa document based app.
    > The problem is that sheet is not displayed as sheet but as normal
    > standalone window!? As far as I remember
    > the method I'm using worked perfectly in Tiger. What am I doing wrong?

    In this call:

    [NSApp beginSheet: connectionSheet
         modalForWindow: window
      modalDelegate: self
         didEndSelector: @selector(didEndSheet:returnCode:contextInfo:)
             contextInfo: nil];

    The variable "window" is *nil*. Whenever that's the case, your sheet
    will appear as a standalone window.

    To fix this:

    * Set the class of the files owner in your document nib to be
    PGWizDocument
    * Connect the window outlet of the files owner (the document) to the
    window in the nib

    j o a r
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today