Ask a Question related to Mac Programming, Design and Development.
-
Christian Witt #1
Cocoa: NSComboBoxCell in NSTableColumn
Hi,
my application uses a NSTableView with one NSTableColumn, which needs
a combobox instead of a texfield as the data-cell. Creating a
NSComboBoxCell-object and setting the data-cell of the
NSTableColumn-object works fine. But the combo-box doesn't look good
with this big blue down-pointing arrow in the table.
I recognized that Interface Builder uses in the Class-inspector-panel
a table-column with a combo-box. But this combo-box has as small black
double-arrow (pointing up and down) and I can't figure out, how to
create such a combo-box.
Any hints?
thanks in advance
Christian
Christian Witt Guest
-
Bit shifts in Cocoa
Does anyone know how to do bit shifts in Cocoa? I have declared an integer and I want to shift it one bit to the right (same as dividing by 2). ... -
Cocoa: does stringWithContentsOfURL do conditional GETs ?
I'm making use of stringWithContentsOfURL in a client which does repeated downloading of an RSS feed (don't worry -- I don't thrash the server). ... -
Q About Cocoa & CF Prefs..
In article <no-EA814A.20172229072003@netnews.upenn.edu>, Mark Haase <no@spam.please> wrote: Not only that, if the same preference file is... -
Cocoa Filemaker
"Edward Smith" <esmith@thegoodstuff.se> wrote in message news:BB44ABA1.4676%esmith@thegoodstuff.se... I presume so. There was a statement from... -
[Cocoa] Bug with NSTableView?
> I'll check these accessor methods, as this may be the problem. It was the setCol* methods that were causing the problem. I stupidly put:... -
M Taylor #2
Re: Cocoa: NSComboBoxCell in NSTableColumn
[email]christian.witt@epost.de[/email] (Christian Witt) wrote in message news:<50052383.0309101102.5d000cb7@posting.google. com>...
Hi Christian,> Hi,
>
> my application uses a NSTableView with one NSTableColumn, which needs
> a combobox instead of a texfield as the data-cell. Creating a
> NSComboBoxCell-object and setting the data-cell of the
> NSTableColumn-object works fine. But the combo-box doesn't look good
> with this big blue down-pointing arrow in the table.
>
> I recognized that Interface Builder uses in the Class-inspector-panel
> a table-column with a combo-box. But this combo-box has as small black
> double-arrow (pointing up and down) and I can't figure out, how to
> create such a combo-box.
>
> Any hints?
>
> thanks in advance
>
> Christian
I'm also trying to create a nicer combobox in the NSTableView, if
you've figured this out, please let me know.
Thanks
Moray
M Taylor Guest
-
Stephan Eggermont #3
Re: Cocoa: NSComboBoxCell in NSTableColumn
M Taylor <bigmugen@freeuk.com> wrote:
Equivalent code with a popup:>>
>> Any hints?
>>
-(void)awakeFromNib{
int count;
id klantPopUpCell;
klantPopUpCell = [[[NSPopUpButtonCell alloc] initTextCell: @"" pullsDown: NO] autorelease];
for (count = 0; count < 4; count++)
{
[klantPopUpCell insertItemWithTitle: [NSString stringWithFormat: @"Klant %i", count] atIndex: count];
}
[klantPopUpCell setEditable: YES];
[klantPopUpCell setBordered: NO];
[[tableView tableColumnWithIdentifier: @"Klant"] setDataCell: klantPopUpCell];
}
The problem with NSPopUpButtonCells is that they don't have a datasource.
So you might have to override
-(void)tableView:(NSTableView*)aTableView
willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn*)aColumn
row:(int)rowIndex;
to fill the popup if the menu is different for each row.
-(id)tableView:(NSTableView*)aTableView
objectValueForTableColumn:(NSTableColumn*)theColum n
row:(int)rowIndex;
expects a number for the currently selected menuitem.
Stephan Eggermont
Sensus, systems that make sense
Stephan Eggermont Guest
-
Christian Witt #4
Re: Cocoa: NSComboBoxCell in NSTableColumn
Stephan Eggermont <stephan@stack.nl> wrote in message news:<bk4gk6$hda$2@news.tue.nl>...
The next problem with NSPopUpButtonCell is, that it does not behave> Equivalent code with a popup:
> The problem with NSPopUpButtonCells is that they don't have a datasource.
> So you might have to override
> -(void)tableView:(NSTableView*)aTableView
> willDisplayCell:(id)aCell
> forTableColumn:(NSTableColumn*)aColumn
> row:(int)rowIndex;
like a textfield and has no autocompletion. I want the behaviour of an
NSComboBoxCell but not that ugly blue arrow.
Ciao
Christian
Christian Witt Guest
-
Stephan Eggermont #5
Re: Cocoa: NSComboBoxCell in NSTableColumn
Christian Witt <christian.witt@epost.de> wrote:
I've tried that, and it seems that there are some bugs in NSComboBoxCell.> The next problem with NSPopUpButtonCell is, that it does not behave
> like a textfield and has no autocompletion. I want the behaviour of an
> NSComboBoxCell but not that ugly blue arrow.
The position and size of the 'blue arrow' are wrong. Not that the
PopUpButton is any better, though. Just put one on a window, and
make it small, pulldown, square and do a size to fit.
Stephan
Stephan Eggermont Guest



Reply With Quote

