nstableview

Location of Add/Delete Buttons for an NSTableView in OS X

杀马特。学长 韩版系。学妹 提交于 2021-02-08 01:59:36
问题 I think I must be missing something simple but being new to Xcode... Specifically I am coding in Swift but I believe this is more of a .xib file question. It is easy to have add and delete buttons outside of an NSTableView (like the native Mail app's Preferences->Signatures panel) but how do you integrate these into what seems to be the NSTableView itself? (more like the native Mail app's Preferences->Accounts panel) Ideally I want the option to have more than just add / delete buttons

Remove row from NSTableview by swiping

牧云@^-^@ 提交于 2021-02-07 10:39:48
问题 I am trying to remove a row from my NStableView by swipe function. I am using macOS 10.13 and swift 4 and pretty new to swift coding. I tried to follow: Implementing NSTableViewRowAction using Swift but it did not work for me. And this is how I implement it: public func tableView(_ tableView: NSTableView, rowActionsForRow row: Int, edge: NSTableView.RowActionEdge) -> [NSTableViewRowAction] { // left swipe if edge == .trailing { let deleteAction = NSTableViewRowAction(style: .destructive,

Remove row from NSTableview by swiping

佐手、 提交于 2021-02-07 10:39:13
问题 I am trying to remove a row from my NStableView by swipe function. I am using macOS 10.13 and swift 4 and pretty new to swift coding. I tried to follow: Implementing NSTableViewRowAction using Swift but it did not work for me. And this is how I implement it: public func tableView(_ tableView: NSTableView, rowActionsForRow row: Int, edge: NSTableView.RowActionEdge) -> [NSTableViewRowAction] { // left swipe if edge == .trailing { let deleteAction = NSTableViewRowAction(style: .destructive,

NSOutlineView row not editable by “Return” key anymore after reloading a different table view cell

萝らか妹 提交于 2021-02-05 08:11:42
问题 I'm running into the strangest issue with my NSOutlineView : Everything is set up in a storyboard, i.e. the outline view and two NSTableCellView s The two cell views are mostly the same, only one shows an icon, the other one doesn't I can begin editing an item (row) by pressing the Return key, i.e. the NSTextField that is part of my NSTableCellView enters into edit mode. This is the default behavior and works fine so far. However: After editing ends and the item was changed, I use the second

NSOutlineView row not editable by “Return” key anymore after reloading a different table view cell

◇◆丶佛笑我妖孽 提交于 2021-02-05 08:11:32
问题 I'm running into the strangest issue with my NSOutlineView : Everything is set up in a storyboard, i.e. the outline view and two NSTableCellView s The two cell views are mostly the same, only one shows an icon, the other one doesn't I can begin editing an item (row) by pressing the Return key, i.e. the NSTextField that is part of my NSTableCellView enters into edit mode. This is the default behavior and works fine so far. However: After editing ends and the item was changed, I use the second

NSTableView - Initial Selection Grey until Clicked (Focussed)

对着背影说爱祢 提交于 2021-02-05 06:38:26
问题 I've got a simple example of an app here which I slapped together, and what I'm getting is pretty much what I'm after. The issue is that when the view loads up, in the NSViewController's viewDidLoad, I set the tableView's selected index to 0 i.e. the first item (which works). What I do notice is that when this happens, the selected row comes up as grey in color (i.e. as if it's not an active window/view)… It only seems to high light in the normal blue color when I physically click on the row

NSTableView in NSScrollView doesn't autoscroll when dragging

半世苍凉 提交于 2021-02-04 19:46:25
问题 I'm currently implementing drag and drop rearranging in a table view in my OS X app. While normal scrolling works fine, autoscroll while dragging it totally broken. If I grab a cell and start dragging, autoscroll just tells the table to scroll to the top. If I manually scroll using the trackpad during dragging the table continually pops to the top. If I drag one of the top cells, the table will not autoscroll down when dragging near the bottom. I subclassed NSScrollView and overrode the

End Editing on NSTableView (View Based)

拥有回忆 提交于 2021-02-04 16:12:06
问题 When a user is mid-editing a textfield on a tableview and decides to click the close button for the window, the changes he/she made does not get saved. How can I force a tableview (view based) to end editing (not abort editing) ? 回答1: The simplest way to do this is to assign a delegate for your window and respond to NSWindow 's -windowShouldClose: delegate method. In it, invoke -makeFirstResponder: to make the window itself the first responder, noting the BOOL answer it gives. You should

how to code NSButton to look just like image

為{幸葍}努か 提交于 2021-01-26 19:49:36
问题 Using code (not the Interface builder) I need to create an NSButton that looks like an image. Specifically I want to use NSImageNameStopProgressFreestandingTemplate and I need it not to look like button but to look like the image. This means: 1. No 'button down' look 2. No border, no any visibility of the button Thanks. 回答1: I know this response is a bit late, but you could try this, given thisButton : [thisButton setImage:[NSImage imageNamed:NSImageNameStopProgressFreestandingTemplate]];

how to code NSButton to look just like image

痞子三分冷 提交于 2021-01-26 19:43:34
问题 Using code (not the Interface builder) I need to create an NSButton that looks like an image. Specifically I want to use NSImageNameStopProgressFreestandingTemplate and I need it not to look like button but to look like the image. This means: 1. No 'button down' look 2. No border, no any visibility of the button Thanks. 回答1: I know this response is a bit late, but you could try this, given thisButton : [thisButton setImage:[NSImage imageNamed:NSImageNameStopProgressFreestandingTemplate]];