• 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
Re: NSComboBoxCell ugliness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSComboBoxCell ugliness


  • Subject: Re: NSComboBoxCell ugliness
  • From: Chuck Pisula <email@hidden>
  • Date: Mon, 3 Nov 2003 16:20:20 -0800

In general the copyWithZone: mechanism works fine in Java. Instead of
implementing copyWithZone you would implement clone. However, there
seems to be a bug which is specific to NSComboBoxCell that keeps
subclassers from properly being able implement clone(). We are looking
into this now.

Another possibility then is for you to try this:

public void tableViewWillDisplayCell (NSTableView aTableView,
Object aCell, NSTableColumn aColumn, int aRow) {
....
{
// handle the combobox cell case.
NSComboBoxCell comboBoxCell = (NSComboBoxCell)aCell;
comboBoxCell.setControlSize(NSCell.SmallControlSize);


comboBoxCell.setFont(NSFont.systemFontOfSize(NSFont.systemFontSizeForCon
trolSize(NSCell.SmallControlSize)));
}
...
}

-chuck

On Nov 3, 2003, at 5:46 AM, Moray Taylor wrote:

> Hi,
>
> Thanks very much for this, however, I understand copyWithZone is part
> of NSCopying, which doesn't seem to be available in Cocoa/Java. Is
> there a workaround for this?
>
> Thanks again
>
> Moray
>
>> This looks like a bug in NSComboBoxCell, specifically the table data
>> cell does not pick up the font when the combo box cell is copied by
>> the table view. You can workaround this by using a subclass of
>> NSComboBoxCell that does this:
>>
>> -(id)copyWithZone:(NSZone *)zone {
>> id copy = [super copyWithZone:zone];
>> [copy setFont:[self font]];
>> }
>>
>> And I'd follow up by logging a bug with apple...
>>
>> -chuck
>>
>> On Oct 31, 2003, at 5:18 AM, Moray Taylor wrote:
>>
>>> Thanks very much for reply.
>>> The setFont method changes the font in the cell itself, but doesn't
>>> affect the attached menu. I also use the NSPopupButtonCell, this
>>> works fine (the menu appears appropriately sized), but the
>>> NSComboBoxCell's menu seems screwed up when used at a small size.
>>>
>>> Has anyone else experienced this problem?
>>>
>>> Thanks a lot
>>>
>>> Moray
>>>
>>>
>>>> One solution could be to change the Font of the Cell.
>>>>
>>>> [myPrototypeCell setFont:[NSFont
>>>> fontWhichFitsWellWithRowSizeOfMyTableView]];
>>>>
>>>> I did this for a NSPopupButtonCell.
>>>>
>>>> On Friday, October 31, 2003, at 12:42 PM, Moray Taylor wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am using an NSComboxBoxCell in an NSTableView, it works fine,
>>>>> but when the menu pops up, the text is vertically cropped.
>>>>>
>>>>> I am using setControlSize(NSCell.SmallControlSize) to make it a
>>>>> nice size, the cell itself adopts this small size, as does the
>>>>> text within it, but the attached menu doesn't seem to work with
>>>>> this size.
>>>>>
>>>>> Is there a solution?
>>>>>
>>>>> Thanks in advance
>>>>>
>>>>> Moray
>>>>> _______________________________________________
>>>>> 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.
>>> _______________________________________________
>>> 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.
> _______________________________________________
> 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.
_______________________________________________
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.

References: 
 >Re: NSComboBoxCell ugliness (From: Moray Taylor <email@hidden>)

  • Prev by Date: Re: Open-source icons and graphics?
  • Next by Date: Re: Security Framework: authorization rights.
  • Previous by thread: Re: NSComboBoxCell ugliness
  • Next by thread: No version in my app
  • Index(es):
    • Date
    • Thread