NSPopUpButtonCell in NSTableView - Vertical Alignment?
NSPopUpButtonCell in NSTableView - Vertical Alignment?
- Subject: NSPopUpButtonCell in NSTableView - Vertical Alignment?
- From: Steve Franks <email@hidden>
- Date: Mon, 28 Oct 2002 15:12:22 +0800
Hi,
I am writing Java/Cocoa apps under 10.2.1 and having cosmetic trouble
embedding a NSPopUpButtonCell in a table.
Everything is working for the popup button EXCEPT the text in the
button itself is obscured. Basically, the bottom 1/3 of the text seems
to be clipped in the popup-button label. Looking at it closer, it
appears that the text in the popup button
is *incorrectly* baseline aligned with the text in the rest of the row.
I can't find anyway to change this, although I am guessing its in
NSTableView somewhere?! I saw the Jiiva application
builder demo has these working correctly (they add stuff to IB
pallette, I am doing programmatically).
Anybody know the magic incantation to get this to work?
Heres the jist of my code:
NSPopUpButtonCell _menuCell = new NSPopUpButtonCell();
Iterator keys = _bankList.keySet().iterator();
while (keys.hasNext()) {
Integer key = (Integer) keys.next();
String bankName = (String) _bankList.get(key);
int bankID = key.intValue();
_menuCell.addItem(bankName); // Adds to end
NSMenuItem addedItem =
_menuCell.itemAtIndex(_menuCell.numberOfItems()-1);
_log.debug("Added Item: " + addedItem);
addedItem.setTag(bankID);
}
// menuCell.setAlignment(NSText.RightTextAlignment); // No effect
_menuCell.setControlSize(NSCell.SmallControlSize); // Doesn't help
// menuCell.setControlSize(NSCell.RegularControlSize); // Doesn't
help
NSTableColumn bankColumn = _table.tableColumnWithIdentifier("Bank");
// bankColumn.sizeToFit(); // A waste of time and makes too narrow!
bankColumn.setDataCell(_menuCell);
--
Steve Franks
ENZOA - Software and Services
email@hidden
_______________________________________________
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.