Detecting when document window is actually displayed

  • Hi,

    I'm trying to display a custom modal sheet on my document windows (only if some condition applies of course), as soon as the document window is displayed. I tried calling beginSheet:modalForWindow: in my window controller's windowDidLoad: method, but that seems to be too early and results in the sheet being displayed separately instead of on the window. I've also checked NSWindowDelegate methods for something usable but so far without success. What would be the preferred place to display the modal sheet?

    Thanks,

    --
    Luc Van Bogaert
  • I've been doing this in -awakeFromNib with a -performSelector:withObject:afterDelay: call. I suspect this is not the 'correct' way to do it, but it does seem to always work.

    Martin

    On 9, Jun, 2012, at 02:33 PM, Luc Van Bogaert wrote:

    > Hi,
    >
    > I'm trying to display a custom modal sheet on my document windows (only if some condition applies of course), as soon as the document window is displayed. I tried calling beginSheet:modalForWindow: in my window controller's windowDidLoad: method, but that seems to be too early and results in the sheet being displayed separately instead of on the window. I've also checked NSWindowDelegate methods for something usable but so far without success. What would be the preferred place to display the modal sheet?
    >
    > Thanks,
    >
    > --
    > Luc Van Bogaert
previous month june 2012 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  
Go to today