Professional Web Applications Themes

newbie xcode problem - Mac Programming

OS X 10.3.2 hello, I am new to xcode (i usually use RB5.2 ) and i have created a new Cocoa application consisting of just a single brushed metal window. I have built the application, but there seems to be 1 small stupid problem that i cant figure out. When i close the window from the application menu at the top of the screen the application quits as expected. However, when i click on the close button on the top left of the actual window, the window disappears but the program is still running in the dock and the application ...

  1. #1

    Default newbie xcode problem

    OS X 10.3.2

    hello,


    I am new to xcode (i usually use RB5.2 ) and i have created a new Cocoa
    application consisting of just a single brushed metal window.

    I have built the application, but there seems to be 1 small stupid
    problem that i cant figure out.

    When i close the window from the application menu at the top of the
    screen the application quits as expected.
    However, when i click on the close button on the top left of the actual
    window, the window disappears but the program is still running in the
    dock and the application menu at the top of the screen is still showing.

    I know i am missing something small and easy but for the life of me I
    cant find out what.

    I will say thank you now (in advance).

    maria Guest

  2. #2

    Default Re: newbie xcode problem

    maria wrote: 

    heh! bet you haven't been using macs long, right? that's the way it's
    *supposed* to work. according to long-standing tradition, closing the
    last window of a mac app does not exit the app.

    if you really want that though, you can get it. Look at the
    doentation for NSApplication, it has a delegate method called
    applicationShouldTerminateAfterLastWindowClosed: that will do what you
    want.
    Jhnny Guest

  3. #3

    Default Re: newbie xcode problem

    In article <com>, maria <com> wrote:
     

    What menu choice are you using to "close the window from the
    application menu" ? The default "Close" is on the File menu unless you
    have moved it for some reason.
     

    As was pointed out by someone else, applications are not supposed to
    close when the last window closes at least by default. Thus if you are
    selecting Quit from the application menu, obviously the window will
    close when the app quits but the opposite is not true by default.

    There are, of course, applications where you want the application to
    quit with the last window and I'm not assuming you don't have a lot of
    experience with Mac programs but if not, you really want to spend some
    time playing with a lot of applications and also in reading stuff like
    the Human Interface Guidelines. However, if the behavior you describe
    is what you want (and again note that it will not be a standard Mac
    program at that point) you can force the application to close with the
    last window by implmenting the application delegate function
    applicationShouldTerminateAfterLastWindowClosed:

    Spence

    --
    James P. Spencer
    Rochester, MN

    "Badges?? We don't need no stinkin badges!"
    James Guest

  4. #4

    Default Re: newbie xcode problem

    In article <140220041005519033%net>,
    James Spencer <net> wrote:
     

    Apparently GarageBand quits when you close the last window. Is it just me or
    is Apple playing pretty fast and loose with their own HI guidelines lately?
    Maybe the rule makes sense for multi-doent applications, but not for
    single-doent ones? Not sure which GarageBand is.
    HiRez Guest

  5. #5

    Default Re: newbie xcode problem

    In article <ash.giganews.com>,
    HiRez <net> wrote:
     
    >
    > Apparently GarageBand quits when you close the last window. Is it just me or
    > is Apple playing pretty fast and loose with their own HI guidelines lately?
    > Maybe the rule makes sense for multi-doent applications, but not for
    > single-doent ones? Not sure which GarageBand is.[/ref]

    I don't know what GarageBand does but you make a good point.
    Interestingly, iTunes does not close the app when the user closes the
    window even though it does not use a doent structure and only
    permits one main window. On the other hand, iPhoto does close the app.
    Personally, I would suggest that this behavior should be limited to
    programs like System Preferences where it really makes sense to only
    have one window and when that window is closed there is nothing for the
    program to do. My biggest dislike of iTunes and iPhoto is that they do
    NOT permit multiple windows and do not use a multiple doent
    structure. I should be able to create whatever libraries of tunes and
    photos I want and I should be able to have more than one open at a
    time.

    Whatever, obviously while this behavior we are talking about is
    "non-standard", it cannot be too terribly wierd when Cocoa makes it so
    easy to enable. After all, Cocoa is designed to make coding per the
    HIG easy and deviating difficult.

    Spence

    --
    James P. Spencer
    Rochester, MN

    "Badges?? We don't need no stinkin badges!"
    James Guest

  6. #6

    Default Re: newbie xcode problem

    In article <140220042300166996%net>,
    James Spencer <net> wrote:
     

    Try double-clicking on a playlist, a CD, or the store some day.

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  7. #7

    Default Re: newbie xcode problem

    In article <140220042300166996%net>,
    James Spencer <net> wrote:
     

    I think iTunes doesn't quit because you can have separate windows open
    for playlists. Some people may close the last playlist and then want to
    re-open the main iTunes window, so iTunes doesn't quit.
     

    Check out iTunes again. You can open several windows there (though only
    one with a "source list" at the left, AFAIK). But otherwise, I agree
    with you. Auto-closing should be restricted to single-window
    applications.
     

    Um, not quite. You have to remember, that most of Cocoa was designed to
    NeXT's user interface guidelines. As such, it makes some things very
    easy that look very weird to Mac people, because that's a route where
    NeXTstep used to work differently.

    Cheers,
    -- Uli
    http://www.zathras.de
    Uli Guest

  8. #8

    Default Re: newbie xcode problem

    In article <t-online.com>, Uli
    Kusterer <de> wrote:
     
    >
    > Check out iTunes again. You can open several windows there (though only
    > one with a "source list" at the left, AFAIK). But otherwise, I agree
    > with you. Auto-closing should be restricted to single-window
    > applications.[/ref]

    I misspoke. What I meant was that iTunes really only allows a single l
    library and while you can have multiple windows, they are all simply
    different views of the same "doent". Still, you are probably right
    regarding the inconsistency with how different iLife programs work.

    Spence

    --
    James P. Spencer
    Rochester, MN

    "Badges?? We don't need no stinkin badges!"
    James Guest

Similar Threads

  1. XCode and NSCFDictionary
    By Hugh in forum Mac Programming
    Replies: 4
    Last Post: February 12th, 12:05 AM
  2. Xcode pain in the
    By Paul in forum Mac Programming
    Replies: 2
    Last Post: January 15th, 09:13 AM
  3. Xcode editor
    By Mike in forum Mac Programming
    Replies: 4
    Last Post: October 30th, 10:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139