cappuccino

CPWindow is blocked after closing CPPanel


I added these two outlets to my AppController.j:

@outlet CPWindow theWindow;
@outlet CPWindow thePanel;

theWindow fills the whole browser window (setFullPlatformWindow:YES).

Now I'm using a CPToolbarItem (inside a CPToolbar which I added to theWindow) performing this method on click:

- (IBAction)showPanel:(id)aSender {

    // ...
    [CPApp runModalForWindow:thePanel];
}

I've created all these UI elements in Interface Builder.

When I'm closing thePanel, theWindow seems to stuck - it is not possible to click buttons or interact with elements in theWindow in any other way.

What's going wrong here?


Solution

  • It's likely you're not dismissing your panel successfully, and so its modal state remains active. Try this in the code responsible for closing your panel:

    [CPApp abortModal];
    [thePanel close];