Background color for Drawers

  • Simple question...

    Is there way to set the background color for a drawer? Unlike NSWindow,
    NSDrawer does not seem to have a background color to set. Nor does it
    use the background color of the parent window. If you set the parent
    window to Metal Texture, the drawer does draws it background using
    metal, but that seems to be the only direct control. I could either
    override the drawers context view to draw a pattern, or put a custom
    view over top of it that draws the pattern, but was hoping for a better
    solution. Did I miss something?

    Thanks,

    Steve Sheets
    Midnight Mage Software
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On 14 Jun 2004, at 5:36 am, Steve Sheets wrote:
    > Is there way to set the background color for a drawer? Unlike
    > NSWindow, NSDrawer does not seem to have a background color to set.

    That's because NSDrawer inherits from NSResponder, not NSWindow.

    > Nor does it use the background color of the parent window. If you set
    > the parent window to Metal Texture, the drawer does draws it
    > background using metal, but that seems to be the only direct control.
    > I could either override the drawers context view to draw a pattern, or
    > put a custom view over top of it that draws the pattern, but was
    > hoping for a better solution. Did I miss something?

    You can set your drawer's contentView to any view you like. Create a
    custom view and draw your pattern (pattern?!) in its -drawRect: method.

    Regards,
    -Jeremy
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Jun 14, 2004, at 5:16 AM, Jeremy Dronfield wrote:

    > You can set your drawer's contentView to any view you like. Create a
    > custom view and draw your pattern (pattern?!) in its -drawRect:
    > method.

    Jeremy,
      That was what i was trying to describe in my original posting. I was
    just hoping for a simpler solution (something like the window set
    background color).

    Steve

    ps Yes, I meant Pattern. I create a NSColor using a NSImage as the
    repeating pattern.
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
previous month june 2004 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        
Go to today