Platforms to show: All Mac Windows Linux Cross-Platform
NSTableViewRowActionMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa Controls | MBS MacControls Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
In an editable table, performing a horizontal swipe on a row reveals a button to delete the row by default. This class lets you define one or more custom actions to display for a given row in your table. Each instance of this class represents a single action to perform and includes the text, formatting information, and behavior for the corresponding button.
To add custom actions to your table view’s rows, implement the rowActionsForRow event in your table view’s delegate object. In that method, create and return an array of actions for the specified row. The table handles the remaining work of displaying the action buttons and executing the appropriate handler block when the user clicks the button.
- event Action(row as Integer)
- 5 properties
- property BackgroundColor as NSColorMBS
- property Handle as Integer
- property Image as NSImageMBS
- property Style as Integer
- property Title as String
- method Constructor(Style as Integer, Title as String)
- shared method available as boolean
- 2 constants
Styles
Constant | Value | Description |
---|---|---|
NSTableViewRowActionStyleDestructive | 1 |
Apply a style that indicates that the action might change or delete data. This style changes the value of the backgroundColor property to an appropriate value to reflect the destructive action. After creating the action object, you can change the background color as needed. Destructive actions require a longer swipe to activate, and trigger an animation when a table row is deleted. |
NSTableViewRowActionStyleRegular | 0 |
Apply the default style to the button. This style does not apply any special coloring to the button. |
This class has no sub classes.
Some events using this class:
- DesktopNSTableControlMBS.rowActionsForRow(row as Integer, edge as Integer) as NSTableViewRowActionMBS()
- NSTableControlMBS.rowActionsForRow(row as Integer, edge as Integer) as NSTableViewRowActionMBS()
Blog Entries
Release notes
- Version 17.1
- Added NSTableViewRowActionMBS class.
The items on this page are in the following plugins: MBS MacControls Plugin.
NSTableViewMBS - NSTabViewItemMBS