Title bar on left of Panel

  • After researching this, I only came up with Carbon references which I'm
    not sure are applicable to Cocoa.

        How do I get the title bar on the the left side of a floating tools
    panel?  I did find out how to get rid of the unused title bar buttons.
  • On Oct 3, 2007, at 3:20 PM, Gordon Apple wrote:

    > After researching this, I only came up with Carbon references
    > which I'm
    > not sure are applicable to Cocoa.
    >
    > How do I get the title bar on the the left side of a floating tools
    > panel?  I did find out how to get rid of the unused title bar buttons.

    Last time I checked (about a year ago) there was no way in Cocoa to
    get a side title bar panel.

    I reported a bug.  As I recall, it was marked as a duplicate.

    Scott
  • Somehow, OmniGraffle does it.  That and their inspector window stuff in
    the title bar is beginning to make me think maybe they use a borderless
    window and fake it.

    >
    > On Oct 3, 2007, at 3:20 PM, Gordon Apple wrote:
    >
    >> After researching this, I only came up with Carbon references
    >> which I'm
    >> not sure are applicable to Cocoa.
    >>
    >> How do I get the title bar on the the left side of a floating tools
    >> panel?  I did find out how to get rid of the unused title bar buttons.
    >
    > Last time I checked (about a year ago) there was no way in Cocoa to
    > get a side title bar panel.
    >
    > I reported a bug.  As I recall, it was marked as a duplicate.
    >
    > Scott
  • Yes, they are borderless windows and custom drawing. All the code is
    published as part of OmniAppKit if you want to take a look at it.

    Hope this helps,
    - Greg

    On Oct 3, 2007, at 2:55 PM, Gordon Apple wrote:

    > Somehow, OmniGraffle does it.  That and their inspector window
    > stuff in
    > the title bar is beginning to make me think maybe they use a
    > borderless
    > window and fake it.
    >
    >>
    >> On Oct 3, 2007, at 3:20 PM, Gordon Apple wrote:
    >>
    >>> After researching this, I only came up with Carbon references
    >>> which I'm
    >>> not sure are applicable to Cocoa.
    >>>
    >>> How do I get the title bar on the the left side of a floating
    >>> tools
    >>> panel?  I did find out how to get rid of the unused title bar
    >>> buttons.
    >>
    >> Last time I checked (about a year ago) there was no way in Cocoa to
    >> get a side title bar panel.
    >>
    >> I reported a bug.  As I recall, it was marked as a duplicate.
    >>
    >> Scott

  • Do not do what follows. It's evil. It works. But it's evil.

    -------------------

    @interface MyLeftAlignedTitleTextFieldCell : NSTextFieldCell
    // do not add any ivars. not even a little tiny one. really. we class
    swizzle this in and if you do add an ivar you'll regret it.
    @end

    @implementation MyLeftAlignedTitleTextFieldCell

    - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView
    *)controlView
    {
    NSColor *textColor;

    if ( [[controlView window] isMainWindow] )
    {
      textColor = [NSColor blackColor];
    }
    else
    {
      textColor = [NSColor disabledControlTextColor];
    }

    NSRect frame = [self titleRectForBounds: cellFrame];
    NSButton *zoomButton =[[controlView window] standardWindowButton:
    NSWindowZoomButton];
    if ( zoomButton )
    {
      frame.origin.x = NSMaxX( [zoomButton frame] );
    }
    frame.origin.x += 6; // just some padding
    frame.origin.y -= 1;
    NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
                             textColor, NSForegroundColorAttributeName,
                             [NSFont titleBarFontOfSize: 0], NSFontAttributeName,
                             nil];
    [[self stringValue] drawInRect: frame withAttributes: attrs];
    }

    @end

    // somewhere early in your startup code but after the nib has been
    loaded.
    // here we have a cascade of evil, each step nuttier than the one
    before.

    if ( [theWindow respondsToSelector: @selector( _borderView )] )
    {
    if ( [[(id) theWindow _borderView] respondsToSelector:
    @selector( titleCell )] )
    {
      if ( [[(id)[(id) theWindow _borderView] titleCell] isKindOfClass:
    [NSTextFieldCell class]] )
      {
      [(id)[(id) theWindow _borderView] titleCell]->isa =
    [MyLeftAlignedTitleTextFieldCell class]; // yikes!
      }
    }
    }

    Later,
    Guy
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