nstableview

NSPopupButton in view based NSTableView: getting bindings to work

懵懂的女人 提交于 2019-12-03 03:26:17
Problem Description I'm trying to achieve something that should be simple and fairly common: having a bindings populated NSPopupButton inside bindings populated NSTableView. Apple describes this for a cell based table in the their documentation Implementing To-One Relationships Using Pop-Up Menus and it looks like this: I can't get this to work for a view based table. The "Author" popup won't populate itself no matter what I do. I have two array controllers, one for the items in the table ( Items ) and one for the authors ( Authors ), both associated with the respective entities in my core

Parse Data into NSTableView

坚强是说给别人听的谎言 提交于 2019-12-03 00:39:24
Hello fellow programmers, First off, I am new to OSX/iOS programming and am trying to learn swift. I am fairly competent in java and wanted to teach myself something new. I am aware that the swift programming language is in it's early stages. I have a table using the parse.com data browser. I can get the elements from that table and store them in an array. Normally, in java, I would then simply iterate over those elements and populate a JTable. Now, my question to you is...How would I go about doing this? I have tried to read the apple api and I felt my IQ dropping. I can understand the

context menu based on NSTableViewCell

时光毁灭记忆、已成空白 提交于 2019-12-02 22:39:29
i would like to place a context menu onto a NSTableView . this part is done. what i would liek to do is to show different menu entries based on the content of the right clicked cell, and do NOT show the context menu for specific columns. this is: column 0, and 1 no context menu all other cells should have the context menu like this: first entry: "delete " samerow.column1.value second entry: "save " samecolumn.headertext hope the question is clear.. thanks -EDIT- the one on the right is how the context menu is supposed to look like for any given cell. Theres a delegate for that! - No need to

How to increase the height of NSTableHeaderView?

独自空忆成欢 提交于 2019-12-02 21:27:43
I need to implement a headerview with specific size and gradient. I have to insert images in certain cells of the headerview .Tried to create the cells for the headerview using the following code,but i was not able to customize the headerview . [[tableColumn headerCell] setImage:[NSImage imageNamed:@"sampleHeader"]]; If I use the overridden subclass of headerview, I was not able to view the images or text in the header cell.Please provide me any pointers to solve this issue. I was able to insert images and text by subclassing the NSTableHeaderCell .How to increase height of the

Creating a custom title bar on a standard NSWindow

时光毁灭记忆、已成空白 提交于 2019-12-02 19:43:13
I've been trying to build a specific look for my menubar app. I've been using a NSWindow with a NSBorderlessWindowMask style mask and setting [window setOpaque:NO] and [window setBackgroundColor:[NSColor clearColor]] . That gives me a blank canvas which works great for the title bar. Now I'm having problems with the view-based NSTableView I'm using for the listing. How can I clip the NSTableCellView s to the window's rounded corners? I started out just having a custom view wrapping the NSTableView , drawing the background with rounded corners. Using [view addClip:path] doesn't clip child views

Draw NSTableView Alternating Rows Like iTunes 11

别说谁变了你拦得住时间么 提交于 2019-12-02 19:42:06
I am aware that there are other questions on SO about changing alternating row colors. That's easy and it's not what I want to do. I want to draw custom alternating-colored rows in a view-based NSTableView that look like those from iTunes 11 (slight bezel at the top and bottom of the row, as shown in this screenshot): NOTE: I know I can subclass NSTableRowView and do my custom drawing there. However, this is NOT an acceptable answer because the custom row will only be used for rows that have data in the table. In other words, if the table has only 5 rows, those 5 rows will use my custom

NSTableView is not being displayed

 ̄綄美尐妖づ 提交于 2019-12-02 15:45:25
问题 This is a follow-up on the previous question. Sorry. I could not figure out how to add code or edit something written over 5 minues ago. A brief summary. I am trying to display a customized/derived TableView over a regular View. I am not using IB, but doing everything from the code. The goal here is to build the application, but also to learn Cocoa/OSX programming. This is my first OSX coding attempt. NSView atop of which I would like to display my custom TableView is being displayed fine.

Preventing contextual menu showing on specific cell in a view based NSTableView

狂风中的少年 提交于 2019-12-02 13:38:09
问题 Is there any way of preventing a contextual menu (and the associated selection "ring" around the cell view) being shown when right-clicking on a specific cell in a view-based NSTableView ? I'm not talking about disabling the right-click action on ALL the cells, but only on specific ones. I've obviously tried all the delegate methods dealing with selection changes but none works because the selectedRow property is not changing, only the clickedRow does. So basically I'm looking for something

Core Data Image Won't Load Into NSTableView Image Cell

折月煮酒 提交于 2019-12-02 08:22:36
In my code I am storing an image into my Core Data model (works fine). If I set up my view to have an NSImageView and bind its Data to Controller Key: selection and modelKeyPath: myImagePath, it works. It will show each image for the selected row. I then create a new column in my NSTableView and drag an image cell onto the column. However, I cannot get my Core Data bindings to have the image show up in the cell. I have tried binding both value and data, but no luck. Since I am sure the image is stored properly, what am I doing wrong in my binding to prevent the image from showing up in the

NSTableView with plist file

烂漫一生 提交于 2019-12-02 06:44:02
问题 I am very new to mac app development. so just doing some practical exercise. I want to create a tableview which display data from my plist file. I have one windowcontroller class and window controller.xib file. I drag and drop NSTableView to the .xib file. and using this code to load plist file - (void)windowDidLoad { [super windowDidLoad]; NSBundle *bundle = [NSBundle mainBundle]; NSString *path = [bundle pathForResource:@"tenth" ofType:@"plist"]; file = [[NSArray alloc]