nstableview

NSTableView row change height on select

How can I change the height of a row when I select it then change it back when it's deselected? ...

Sorting of table column by string length not working as intended when done in IB via cocoa - bindings

Hi all, I made a sample application displaying list of employees with their salaries over NSTableView using NSArrayController. Basic functionality is working as intended. Also sorting is working fine when Selector - compare or caseInsensitiveCompare is assigned in attribute pane for table column- employeeName. Problem occurs when I tr...

NSTableView get rid blank space separating columns

I have an NSTableView with 4 columns. I also have a custom background color for each row. The only problem is I have these ugly white spaces where the gridlines would go in both the horizontal and vertical axis. I have both unchecked in IB, but they still show up. How can I get rid of the vertical ones and change the color and size of...

NSTableView not refreshing

I have a table view that gets refreshed two different ways. Both are through a button, and as a matter of fact, both are through the same IBAction in the same class! Here's my problem: The buttons are in two different .xib files, the button in the same xib as the table view works perfectly, while the one in the different xib does the ...

Cocoa: Set selected color

How can I set the selection color? In this case, it's the color of a selection in an NSTableView edit: Here's my subclass: - (void)highlightSelectionInClipRect:(NSRect)clipRect { NSBezierPath *windowPath; windowPath = [NSBezierPath bezierPathWithRect:clipRect]; [[NSColor greenColor] set]; [windowPath fill]; } The only problem is th...

NSButtonCell created programmatically doesn't highlight when clicked

I wanted to have a button appear in a table view as the first element on the last row instead of the normal data, so I created a subclass of NSTableView and overwrote the preparedCellAtColumn:row: method to generate the desired behaviour on the last row. - (NSCell *)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row { if(row ...

NSTableView with custom NSColumnHeaderCell

In my application I have an NSTableView with a custom header cell that is programatically assigned. The code to assign the custom cell looks like this: -(void)setupTableHeader:(id)table { NSArray *columns = [table tableColumns]; NSEnumerator *cols = [columns objectEnumerator]; NSTableColumn *col = nil; TRDarkTableColumnHea...

A way to implement a sideways NSTextFieldCell?

I have an NSTableView in my application with data being drawn in for both the X and Y axes (ie, every row is matched with every column.) I've got the data populating the cells the way I'd like, but it looks terrible with the columns stretched out horizontally. I would like to turn the NSTextFieldCell on its side, so that the text is wri...

Sorting nil-valued rows always to bottom in nstableview column

Hi there, I have an nstableview in my application containing several columns. When I click on one column header in order to have it sorted ascending, rows with a nil-value in that column are being sorted on top followed by non-nil-valued rows in ascending order. If I reclick on the same column, first the non-nil-valued rows are being sh...

Custom field editor for NSTextFieldCell in an NSTableView

I have a custom NSTableView subclass filled with several custom NSTextFieldCell subclasses. I would like to be able to change the edited cell by using the arrow keys. I am able to accomplish this by creating a custom field editor (by subclassing NSTextView) and returning it from the window delegate like so: - (id) windowWillReturnField...

NSTableView - programatic display of values in a long table view

Ok, so I am creating an iTunes overlay for a client. My question is, with a given index, how am I able to move the displayed cells/cells in a row to a specific entry in the table view, programatically. In other words, replicating iTunes when you are on a playlist it jumps in its table view to the next song if the table view (strictly th...

How to set row height based on its content in table?

Hi all, Generally, table has a fixed row height but according to my requirements I need to set height of each row according to content within it. Can anyone suggest me some solution for it? Thanks, Miraaj ...

how to get count of records and aggregate of values via NSArrayController and cocoa bindings

Hi all, I am trying a simple application using NSArrayController and cocoa bindings. The application contains - a table with only one column, two buttons "+, -" to add and delete records, two text fields to show count of records entered and sum of these records. To allow user to enter numbers only, I have assigned NSNumberFormatter to ...

NSTableView Row Height based on NSStrings

Basically, I have an NSTableView with 1 collumn, and I'm inserting long strings into each row. However, not all the strings are long, so I'd like the height of each row to be different based on how long the string is. I've figured out that I need to ask the collumn how wide it is, and then ask the string how many lines it will take up i...

Cocoa bindings to display NSDictionary keys in NSTableView

I currently have a NSArrayController whose content property is (programmatically) set to an NSMutableDictionary and my UI has a single NSTableView. The information that the NSMutableDictionary contains is not set via the UI. How would I use Cocoa bindings to display the dictionary keys in NSTableView? I already know how to use the Dat...

Refreshing an NSTableView with modified contents of NSMutableDictionary

I have a NSDictionaryController whose content is bound to a NSMutableDictionary, both initialized and connected in Interface Builder. After a certain IBAction is called, the contents of the dictionary are programmatically modified. The NSTableView, which is hooked up with Cocoa bindings to the NSDictionaryController, does not get updat...

Class 'TableDataSource' does not implement the 'NSTableViewDelegate' protocol

What methods should be implemented? I've tried to set the TableDataSource as a delegate to my TableView, but delegate methods wasn't called. After that I tried to set "TableDataSource" as delegate in code, and got this warning: warning: class 'TableDataSource' does not implement the 'NSTableViewDelegate' protocol Delegate metho...

Refreshing NSTableView in inactive NSWindow

I have an application with a primary window and a floating window with a tableview in it. When I modify in the primary window the input for the floating window (which makes the floating window inactive or not key) then the tableview does not show the new data in spite of calling reloadData: on the tableview. I also tried refreshing the ...

tableView:heightOfRow: never called.

Hi there. I'm trying to get a row in my table view to resize its height, but the delegate method: - (CGFloat) tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row is never called. I have implemented other delegate methods and they work perfectly. Is there something I am not doing? Thank you! ...

Automatic NSView resizing.

Hi there. I'm doing something with cocoa which I think is a bit complicate for a beginner like me. I tried a few things, but I admit I need some theory first, because I would like to understand exactly the meaning of this concepts. I see that every NSView and every class that subclasses it has one thing called frame, and one called bou...