Thin Windows

  • I would like to create a tall, thin toolbar for my application but I
    can't seem to create a panel thin enough. I'm thinking about 30 pixels
    wide. It seems as though I cannot go thinner than 59 pixels for a
    panel, if I remove the text for the title of the panel.

    Is it possible to go thinner?

    Thanks,
    Jason
  • On 2007 Oct, 23, at 0:58, Jason Barker wrote:

    > I would like to create a tall, thin toolbar for my application but I
    > can't seem to create a panel thin enough. I'm thinking about 30 pixels
    > wide. It seems as though I cannot go thinner than 59 pixels for a
    > panel, if I remove the text for the title of the panel.
    >
    > Is it possible to go thinner?

    Yes, this can be done if you create the window programatically.  That
    sounds daunting, but it takes surprisingly little code.  Check out
    the "ToolTip" class written by Eric Forget which is in the ^first^
    code box on this page:

    http://www.cocoadev.com/index.pl?ToolTip

    I have adapted this class for use in my app.  Just for fun, in the -
    setString method, I set the width to 30, compiled my app, and it worked.
  • On 23.10.2007, at 09:58, Jason Barker wrote:
    > I would like to create a tall, thin toolbar for my application but I
    > can't seem to create a panel thin enough. I'm thinking about 30 pixels
    > wide. It seems as though I cannot go thinner than 59 pixels for a
    > panel, if I remove the text for the title of the panel.
    >
    > Is it possible to go thinner?

      Have you checked the minimum/maximum size settings in the "Size"
    pane of the window inspector? If that isn't sufficient, you can
    definitely create narrower windows from code, using alloc/
    initWithFrame:style:... (or whatever the exact name of NSWindow's
    init method was). So, you may be running at a limitation in Interface
    Builder, at worst.

    Cheers,
    -- M. Uli Kusterer
    http://www.zathras.de
  • On Oct 23, 2007, at 9:01 AM, Jerry Krinock wrote:

    >
    > On 2007 Oct, 23, at 0:58, Jason Barker wrote:
    >
    >> I would like to create a tall, thin toolbar for my application but I
    >> can't seem to create a panel thin enough. I'm thinking about 30
    >> pixels
    >> wide. It seems as though I cannot go thinner than 59 pixels for a
    >> panel, if I remove the text for the title of the panel.
    >>
    >> Is it possible to go thinner?
    >
    > Yes, this can be done if you create the window programatically.
    > That sounds daunting, but it takes surprisingly little code.

    or just resize the window programmatically before you make it visible.

    that way you can do the layout in IB (keeping everything aligned to
    the bottom left) and then just resize the window.
  • > or just resize the window programmatically before you make it visible.

    IOW, just resize in an awakeFromNib: method. When a window is created and
    shown in any of the normal ways, this is called after outlets are all set up
    but before the window is visible.

    --
    Scott Ribe
    <scott_ribe...>
    http://www.killerbytes.com/
    (303) 722-0567 voice
previous month october 2007 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 31        
Go to today