Professional Web Applications Themes

Cocoa: resizing window - Mac Programming

Hi all, I'm writing a Cocoa app and I've got a prefences window that looks like the System Prefences. I.e. I use a NSTabView and NSToolbar. I'm trying to get the full effect but can't seem to get the window to resize properly. I basically have two problems: 1) I can't figure out the exact height I should resize to. If I use a NSBox then it doesn't include the height of the toolbar. 2) When I do resize the window to a smaller size it seems to chop off from the top. So all my control elements aren't visible. ...

  1. #1

    Default Cocoa: resizing window

    Hi all,

    I'm writing a Cocoa app and I've got a prefences window that looks
    like the System Prefences. I.e. I use a NSTabView and NSToolbar. I'm
    trying to get the full effect but can't seem to get the window to
    resize properly. I basically have two problems:

    1) I can't figure out the exact height I should resize to. If I use a
    NSBox then it doesn't include the height of the toolbar.

    2) When I do resize the window to a smaller size it seems to chop off
    from the top. So all my control elements aren't visible.

    I've seen posts saying the resizing is easy so I guess I'm doing
    something seriously wrong. I wouldn't mind if someone could point me
    in the right direction.
    Harold Guest

  2. #2

    Default Re: Cocoa: resizing window

    In article <google.com>,
    com (Harold Chu) wrote:
     

    Why can't you just calculate a new size by adding the toolbar height to your
    NSBox (content) height?
     

    It sounds like your sizing settings are wrong in Interface Builder. If you
    have an NSBox containing all the sub-elements, and you want the top to stay
    where it is, and everything to resize down, set the box's sizing options to
    something like this:

    +---------------+
    | | |
    | | |
    | +-------+ |
    | | | |
    | | | |
    |---|-------|---|
    | | | |
    | | | |
    | +-------+ |
    | |
    | |
    +---------------+

    Also set minimum sizes so it can't be sized smaller than the content (unless
    you want to use an NSScrollView...probably not). I'm not sure I'm
    understanding exactly whay you wree trying to do though.
    HiRez Guest

  3. #3

    Default Re: Cocoa: resizing window

    There is a similar post at:

    http://cocoa.mamasam.com/COCOADEV/2003/08/2/71256.php

    The suggestions look promising.
     
    Harold Guest

Similar Threads

  1. Modeless dialog parent window in Cocoa
    By ZZmiy@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 4
    Last Post: September 16th, 08:30 AM
  2. window.open - resizing a window
    By Catflea in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 15th, 01:00 AM
  3. Fixing Tab Order in Cocoa Window
    By ifiaz in forum Mac Programming
    Replies: 2
    Last Post: September 29th, 03:55 PM
  4. Cocoa, changing window close behavior?
    By None in forum Mac Programming
    Replies: 7
    Last Post: August 21st, 07:13 AM
  5. multiple doent and window types in cocoa
    By matt neuburg in forum Mac Programming
    Replies: 0
    Last Post: July 21st, 02:35 PM

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