Writing app with multiple panels for OS X





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have a regular OS X app (not document-based) that opens image and shows some additional data in separate views.
I want to refactor the same app so that it will use separate panels (or windows) instead of each view.
The panels should have captions and usual window controls.
I do not want this to be a document-based application.
How can it be done?



Update: this is how I do it



- (void)applicationWillFinishLaunching:(NSNotification *)aNotification{

self.pwc=[[SomeWindowController alloc]initWithWindowNibName:@"SomeWindowController"];
[self.pwc showWindow:self.pwc];


The SomeWindowController is derived from NSWindowController



On last line the app crashes. So what is the correct way to deploy additional window?










share|improve this question

























  • Read the documentation for NSWindowController.

    – Charles Srstka
    Nov 23 '18 at 15:26











  • How do you create the window and the views?

    – Willeke
    Nov 24 '18 at 1:15











  • Accordingly to what I found in the Net: window with all views is defined in .xib file. I instantiate it in AppDelegate::applicationWillFinishLaunching and then I don't know how to present it properly. I updated the question body for more details.

    – Boris
    Nov 24 '18 at 6:48


















0















I have a regular OS X app (not document-based) that opens image and shows some additional data in separate views.
I want to refactor the same app so that it will use separate panels (or windows) instead of each view.
The panels should have captions and usual window controls.
I do not want this to be a document-based application.
How can it be done?



Update: this is how I do it



- (void)applicationWillFinishLaunching:(NSNotification *)aNotification{

self.pwc=[[SomeWindowController alloc]initWithWindowNibName:@"SomeWindowController"];
[self.pwc showWindow:self.pwc];


The SomeWindowController is derived from NSWindowController



On last line the app crashes. So what is the correct way to deploy additional window?










share|improve this question

























  • Read the documentation for NSWindowController.

    – Charles Srstka
    Nov 23 '18 at 15:26











  • How do you create the window and the views?

    – Willeke
    Nov 24 '18 at 1:15











  • Accordingly to what I found in the Net: window with all views is defined in .xib file. I instantiate it in AppDelegate::applicationWillFinishLaunching and then I don't know how to present it properly. I updated the question body for more details.

    – Boris
    Nov 24 '18 at 6:48














0












0








0








I have a regular OS X app (not document-based) that opens image and shows some additional data in separate views.
I want to refactor the same app so that it will use separate panels (or windows) instead of each view.
The panels should have captions and usual window controls.
I do not want this to be a document-based application.
How can it be done?



Update: this is how I do it



- (void)applicationWillFinishLaunching:(NSNotification *)aNotification{

self.pwc=[[SomeWindowController alloc]initWithWindowNibName:@"SomeWindowController"];
[self.pwc showWindow:self.pwc];


The SomeWindowController is derived from NSWindowController



On last line the app crashes. So what is the correct way to deploy additional window?










share|improve this question
















I have a regular OS X app (not document-based) that opens image and shows some additional data in separate views.
I want to refactor the same app so that it will use separate panels (or windows) instead of each view.
The panels should have captions and usual window controls.
I do not want this to be a document-based application.
How can it be done?



Update: this is how I do it



- (void)applicationWillFinishLaunching:(NSNotification *)aNotification{

self.pwc=[[SomeWindowController alloc]initWithWindowNibName:@"SomeWindowController"];
[self.pwc showWindow:self.pwc];


The SomeWindowController is derived from NSWindowController



On last line the app crashes. So what is the correct way to deploy additional window?







objective-c macos cocoa nswindow nswindowcontroller






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 24 '18 at 7:18







Boris

















asked Nov 23 '18 at 14:56









BorisBoris

374112




374112













  • Read the documentation for NSWindowController.

    – Charles Srstka
    Nov 23 '18 at 15:26











  • How do you create the window and the views?

    – Willeke
    Nov 24 '18 at 1:15











  • Accordingly to what I found in the Net: window with all views is defined in .xib file. I instantiate it in AppDelegate::applicationWillFinishLaunching and then I don't know how to present it properly. I updated the question body for more details.

    – Boris
    Nov 24 '18 at 6:48



















  • Read the documentation for NSWindowController.

    – Charles Srstka
    Nov 23 '18 at 15:26











  • How do you create the window and the views?

    – Willeke
    Nov 24 '18 at 1:15











  • Accordingly to what I found in the Net: window with all views is defined in .xib file. I instantiate it in AppDelegate::applicationWillFinishLaunching and then I don't know how to present it properly. I updated the question body for more details.

    – Boris
    Nov 24 '18 at 6:48

















Read the documentation for NSWindowController.

– Charles Srstka
Nov 23 '18 at 15:26





Read the documentation for NSWindowController.

– Charles Srstka
Nov 23 '18 at 15:26













How do you create the window and the views?

– Willeke
Nov 24 '18 at 1:15





How do you create the window and the views?

– Willeke
Nov 24 '18 at 1:15













Accordingly to what I found in the Net: window with all views is defined in .xib file. I instantiate it in AppDelegate::applicationWillFinishLaunching and then I don't know how to present it properly. I updated the question body for more details.

– Boris
Nov 24 '18 at 6:48





Accordingly to what I found in the Net: window with all views is defined in .xib file. I instantiate it in AppDelegate::applicationWillFinishLaunching and then I don't know how to present it properly. I updated the question body for more details.

– Boris
Nov 24 '18 at 6:48












1 Answer
1






active

oldest

votes


















0














I figured out the reason of crash. The window contained QLCompactPreview object and in process of initialization it failed.
When I removed the preview the new window appeared.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53448915%2fwriting-app-with-multiple-panels-for-os-x%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I figured out the reason of crash. The window contained QLCompactPreview object and in process of initialization it failed.
    When I removed the preview the new window appeared.






    share|improve this answer




























      0














      I figured out the reason of crash. The window contained QLCompactPreview object and in process of initialization it failed.
      When I removed the preview the new window appeared.






      share|improve this answer


























        0












        0








        0







        I figured out the reason of crash. The window contained QLCompactPreview object and in process of initialization it failed.
        When I removed the preview the new window appeared.






        share|improve this answer













        I figured out the reason of crash. The window contained QLCompactPreview object and in process of initialization it failed.
        When I removed the preview the new window appeared.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 24 '18 at 8:05









        BorisBoris

        374112




        374112
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53448915%2fwriting-app-with-multiple-panels-for-os-x%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown