• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Question about NSMatrix (was Re: Setting a class' action)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about NSMatrix (was Re: Setting a class' action)


  • Subject: Question about NSMatrix (was Re: Setting a class' action)
  • From: Andrew Merenbach <email@hidden>
  • Date: Thu, 15 Aug 2002 16:07:14 -0700

Thanks to all who responded to my earlier post about assigning a single action to many buttons. It looks like the NSMatrix class is indeed what I'm looking for, but I have another question. I've created a giant matrix, and many of the buttons are transparent, and it works. In creating my various subclasses of NSButtonCell to color the buttons, I had to override drawInteriorWithFrame: with the following, for example:

- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
[[NSColor colorWithDeviceRed:1 green:0 blue:0 alpha:.25] set];
[NSBezierPath fillRect: cellFrame];
}

...which creates a red button. Unfortunately, in overriding drawInteriorWithFrame:, the buttons' titles, which I assigned in Interface Builder, do not show up. Is there a simple way to ask the system to draw the titles of the buttons, from within drawInteriorWithFrame, or should I override a different method?

Take care,
Andrew Merenbach
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: SIGBUS errors when dragging from the Finder to an NSTableView
  • Next by Date: Re: How do you draw a single pixel line?
  • Previous by thread: Re: Table grid lines won't draw
  • Next by thread: NSPopUpButton addItemsWithTitles is way slow
  • Index(es):
    • Date
    • Thread