Small control size inside NSMatrix
Small control size inside NSMatrix
- Subject: Small control size inside NSMatrix
- From: Rudi Sherry <email@hidden>
- Date: Fri, 11 Feb 2005 09:05:27 -0800
I have a window in which I want to display a table of switches
(checkboxes) and use the small control size. All the controls are
Regular size, no matter what I call.
I populate the window programatically (I use an externally-supplied
configuration file so I can't pre-populate it in Interface Builder).
In Interface Building, I made sure that the original cell inside the
matrix was a switch whose size was set to "Small".
I use the following code to populate the matrix (both with and without
the commented-out font-setting).
NSButtonCell *newButtonCell = [ [ [ NSButtonCell alloc ] init ]
autorelease ];
[ newButtonCell setButtonType: NSSwitchButton ];
[ newButtonCell setControlSize: NSSmallControlSize ];
[ newButtonCell setAttributedTitle:
[ [ [ NSAttributedString alloc ] initWithString: myName ]
autorelease ] ];
//[ newButtonCell setFont: [ NSFont controlContentFontOfSize:
// [ NSFont systemFontSizeForControlSize: NSSmallControlSize ] ]
];
[ newButtonCell setState: checked ? NSOnState : NSOffState ];
[ myMatrix putCell: newButtonCell atRow: myRow column: myColumn ];
... but the switches all appear in regular size. Other switches that I
create as Small in IB for other purposes (and don't populate in the
code) all correctly appear small in the window when I run it.
Is there something I'm missing?
Thanks,
Rudi
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden