Is it possible to group items in a NSPopupButton?
I'm trying to display a list of system voices, but I'd like to group them by region.
This is an example of select in html.
Ideally I'd like to create a dropdown that is similar to accessibility language selection.
Is there any way to replicate this in Interface Builder / swift?
Any pointers would be appreciated.
Update:
The reason for this, is because I am displaying a list of speech voices to the user. At the moment, it mixes all the regions together, which is very confusing.
There is an update I'm working on, where I can display "English (United Kingdom)", but I'd like to group them up before releasing it.
swift xcode macos interface-builder
|
show 3 more comments
I'm trying to display a list of system voices, but I'd like to group them by region.
This is an example of select in html.
Ideally I'd like to create a dropdown that is similar to accessibility language selection.
Is there any way to replicate this in Interface Builder / swift?
Any pointers would be appreciated.
Update:
The reason for this, is because I am displaying a list of speech voices to the user. At the moment, it mixes all the regions together, which is very confusing.
There is an update I'm working on, where I can display "English (United Kingdom)", but I'd like to group them up before releasing it.
swift xcode macos interface-builder
2
I don't think there's an off-the-shelf control like that. You should be able to build it using a table view though. (I work mostly in iOS these days so my Mac Cocoa is getting rusty.)
– Duncan C
Nov 18 '18 at 12:16
2
@DuncanC is right. Your second screenshot appears to be anNSTableView
shown inside a modal sheet. So if that's what you're trying to replicate, that's where you should start.
– TheNextman
Nov 18 '18 at 19:03
1
After further digging I found that no,NSTableView
does not support sections. I found this link where somebody did the hard work: blog.krzyzanowskim.com/2015/05/29/…
– Duncan C
Nov 19 '18 at 0:52
1
Well, it supports group rows: developer.apple.com/documentation/appkit/nstableviewdelegate/…. The API is not the same and not as nice as on iOS (NSTableView
predatesUITableView
), and you could have a hard time depending on how your data is structured
– TheNextman
Nov 19 '18 at 2:41
1
I checked with Accessibility Inspector, and the voice table in your second screenshot is anNSTableView
– TheNextman
Nov 19 '18 at 2:45
|
show 3 more comments
I'm trying to display a list of system voices, but I'd like to group them by region.
This is an example of select in html.
Ideally I'd like to create a dropdown that is similar to accessibility language selection.
Is there any way to replicate this in Interface Builder / swift?
Any pointers would be appreciated.
Update:
The reason for this, is because I am displaying a list of speech voices to the user. At the moment, it mixes all the regions together, which is very confusing.
There is an update I'm working on, where I can display "English (United Kingdom)", but I'd like to group them up before releasing it.
swift xcode macos interface-builder
I'm trying to display a list of system voices, but I'd like to group them by region.
This is an example of select in html.
Ideally I'd like to create a dropdown that is similar to accessibility language selection.
Is there any way to replicate this in Interface Builder / swift?
Any pointers would be appreciated.
Update:
The reason for this, is because I am displaying a list of speech voices to the user. At the moment, it mixes all the regions together, which is very confusing.
There is an update I'm working on, where I can display "English (United Kingdom)", but I'd like to group them up before releasing it.
swift xcode macos interface-builder
swift xcode macos interface-builder
edited Nov 20 '18 at 15:57
Daniel P
asked Nov 18 '18 at 10:11
Daniel PDaniel P
1,93231517
1,93231517
2
I don't think there's an off-the-shelf control like that. You should be able to build it using a table view though. (I work mostly in iOS these days so my Mac Cocoa is getting rusty.)
– Duncan C
Nov 18 '18 at 12:16
2
@DuncanC is right. Your second screenshot appears to be anNSTableView
shown inside a modal sheet. So if that's what you're trying to replicate, that's where you should start.
– TheNextman
Nov 18 '18 at 19:03
1
After further digging I found that no,NSTableView
does not support sections. I found this link where somebody did the hard work: blog.krzyzanowskim.com/2015/05/29/…
– Duncan C
Nov 19 '18 at 0:52
1
Well, it supports group rows: developer.apple.com/documentation/appkit/nstableviewdelegate/…. The API is not the same and not as nice as on iOS (NSTableView
predatesUITableView
), and you could have a hard time depending on how your data is structured
– TheNextman
Nov 19 '18 at 2:41
1
I checked with Accessibility Inspector, and the voice table in your second screenshot is anNSTableView
– TheNextman
Nov 19 '18 at 2:45
|
show 3 more comments
2
I don't think there's an off-the-shelf control like that. You should be able to build it using a table view though. (I work mostly in iOS these days so my Mac Cocoa is getting rusty.)
– Duncan C
Nov 18 '18 at 12:16
2
@DuncanC is right. Your second screenshot appears to be anNSTableView
shown inside a modal sheet. So if that's what you're trying to replicate, that's where you should start.
– TheNextman
Nov 18 '18 at 19:03
1
After further digging I found that no,NSTableView
does not support sections. I found this link where somebody did the hard work: blog.krzyzanowskim.com/2015/05/29/…
– Duncan C
Nov 19 '18 at 0:52
1
Well, it supports group rows: developer.apple.com/documentation/appkit/nstableviewdelegate/…. The API is not the same and not as nice as on iOS (NSTableView
predatesUITableView
), and you could have a hard time depending on how your data is structured
– TheNextman
Nov 19 '18 at 2:41
1
I checked with Accessibility Inspector, and the voice table in your second screenshot is anNSTableView
– TheNextman
Nov 19 '18 at 2:45
2
2
I don't think there's an off-the-shelf control like that. You should be able to build it using a table view though. (I work mostly in iOS these days so my Mac Cocoa is getting rusty.)
– Duncan C
Nov 18 '18 at 12:16
I don't think there's an off-the-shelf control like that. You should be able to build it using a table view though. (I work mostly in iOS these days so my Mac Cocoa is getting rusty.)
– Duncan C
Nov 18 '18 at 12:16
2
2
@DuncanC is right. Your second screenshot appears to be an
NSTableView
shown inside a modal sheet. So if that's what you're trying to replicate, that's where you should start.– TheNextman
Nov 18 '18 at 19:03
@DuncanC is right. Your second screenshot appears to be an
NSTableView
shown inside a modal sheet. So if that's what you're trying to replicate, that's where you should start.– TheNextman
Nov 18 '18 at 19:03
1
1
After further digging I found that no,
NSTableView
does not support sections. I found this link where somebody did the hard work: blog.krzyzanowskim.com/2015/05/29/…– Duncan C
Nov 19 '18 at 0:52
After further digging I found that no,
NSTableView
does not support sections. I found this link where somebody did the hard work: blog.krzyzanowskim.com/2015/05/29/…– Duncan C
Nov 19 '18 at 0:52
1
1
Well, it supports group rows: developer.apple.com/documentation/appkit/nstableviewdelegate/…. The API is not the same and not as nice as on iOS (
NSTableView
predates UITableView
), and you could have a hard time depending on how your data is structured– TheNextman
Nov 19 '18 at 2:41
Well, it supports group rows: developer.apple.com/documentation/appkit/nstableviewdelegate/…. The API is not the same and not as nice as on iOS (
NSTableView
predates UITableView
), and you could have a hard time depending on how your data is structured– TheNextman
Nov 19 '18 at 2:41
1
1
I checked with Accessibility Inspector, and the voice table in your second screenshot is an
NSTableView
– TheNextman
Nov 19 '18 at 2:45
I checked with Accessibility Inspector, and the voice table in your second screenshot is an
NSTableView
– TheNextman
Nov 19 '18 at 2:45
|
show 3 more comments
2 Answers
2
active
oldest
votes
The following code groups menu, but not like the way you mentioned.
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let firstMenuItem = NSMenuItem(title: "First Group", action: nil, keyEquivalent: "")
let secondMenuItem = NSMenuItem(title: "Second Group", action: nil, keyEquivalent: "")
let thirdMenuItem = NSMenuItem(title: "Third Group", action: nil, keyEquivalent: "")
let superMenu = NSMenu()
superMenu.addItem(firstMenuItem)
superMenu.addItem(secondMenuItem)
superMenu.addItem(thirdMenuItem)
for (index,item) in items.enumerated()
{
let menu = NSMenu()
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
superMenu.setSubmenu(menu, for: superMenu.items[index])
}
popupButton.menu = superMenu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Add the popupbutton in your code and you will get results like this
Each one will be having its own items inside.
At this point, anything is better than what I currently have. Thank you.
– Daniel P
Nov 20 '18 at 7:50
The menu is displaying perfectly, however whenever I select an item it defaults back to the first entry. :(
– Daniel P
Nov 24 '18 at 16:31
I figured it out. See my answer here: stackoverflow.com/questions/53465965/…
– Daniel P
Nov 25 '18 at 18:19
add a comment |
If you don't have the group heading, you can use the following code
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let menu = NSMenu()
for item in items
{
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
}
popupButton.menu = menu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Result :
Your other answer works better.
– Daniel P
Nov 20 '18 at 15:53
I have updated the question with a picture with my current issue. Hopefully it'll make sense why your other answer is preferable.
– Daniel P
Nov 20 '18 at 15:58
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53359751%2fis-it-possible-to-group-items-in-a-nspopupbutton%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The following code groups menu, but not like the way you mentioned.
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let firstMenuItem = NSMenuItem(title: "First Group", action: nil, keyEquivalent: "")
let secondMenuItem = NSMenuItem(title: "Second Group", action: nil, keyEquivalent: "")
let thirdMenuItem = NSMenuItem(title: "Third Group", action: nil, keyEquivalent: "")
let superMenu = NSMenu()
superMenu.addItem(firstMenuItem)
superMenu.addItem(secondMenuItem)
superMenu.addItem(thirdMenuItem)
for (index,item) in items.enumerated()
{
let menu = NSMenu()
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
superMenu.setSubmenu(menu, for: superMenu.items[index])
}
popupButton.menu = superMenu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Add the popupbutton in your code and you will get results like this
Each one will be having its own items inside.
At this point, anything is better than what I currently have. Thank you.
– Daniel P
Nov 20 '18 at 7:50
The menu is displaying perfectly, however whenever I select an item it defaults back to the first entry. :(
– Daniel P
Nov 24 '18 at 16:31
I figured it out. See my answer here: stackoverflow.com/questions/53465965/…
– Daniel P
Nov 25 '18 at 18:19
add a comment |
The following code groups menu, but not like the way you mentioned.
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let firstMenuItem = NSMenuItem(title: "First Group", action: nil, keyEquivalent: "")
let secondMenuItem = NSMenuItem(title: "Second Group", action: nil, keyEquivalent: "")
let thirdMenuItem = NSMenuItem(title: "Third Group", action: nil, keyEquivalent: "")
let superMenu = NSMenu()
superMenu.addItem(firstMenuItem)
superMenu.addItem(secondMenuItem)
superMenu.addItem(thirdMenuItem)
for (index,item) in items.enumerated()
{
let menu = NSMenu()
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
superMenu.setSubmenu(menu, for: superMenu.items[index])
}
popupButton.menu = superMenu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Add the popupbutton in your code and you will get results like this
Each one will be having its own items inside.
At this point, anything is better than what I currently have. Thank you.
– Daniel P
Nov 20 '18 at 7:50
The menu is displaying perfectly, however whenever I select an item it defaults back to the first entry. :(
– Daniel P
Nov 24 '18 at 16:31
I figured it out. See my answer here: stackoverflow.com/questions/53465965/…
– Daniel P
Nov 25 '18 at 18:19
add a comment |
The following code groups menu, but not like the way you mentioned.
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let firstMenuItem = NSMenuItem(title: "First Group", action: nil, keyEquivalent: "")
let secondMenuItem = NSMenuItem(title: "Second Group", action: nil, keyEquivalent: "")
let thirdMenuItem = NSMenuItem(title: "Third Group", action: nil, keyEquivalent: "")
let superMenu = NSMenu()
superMenu.addItem(firstMenuItem)
superMenu.addItem(secondMenuItem)
superMenu.addItem(thirdMenuItem)
for (index,item) in items.enumerated()
{
let menu = NSMenu()
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
superMenu.setSubmenu(menu, for: superMenu.items[index])
}
popupButton.menu = superMenu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Add the popupbutton in your code and you will get results like this
Each one will be having its own items inside.
The following code groups menu, but not like the way you mentioned.
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let firstMenuItem = NSMenuItem(title: "First Group", action: nil, keyEquivalent: "")
let secondMenuItem = NSMenuItem(title: "Second Group", action: nil, keyEquivalent: "")
let thirdMenuItem = NSMenuItem(title: "Third Group", action: nil, keyEquivalent: "")
let superMenu = NSMenu()
superMenu.addItem(firstMenuItem)
superMenu.addItem(secondMenuItem)
superMenu.addItem(thirdMenuItem)
for (index,item) in items.enumerated()
{
let menu = NSMenu()
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
superMenu.setSubmenu(menu, for: superMenu.items[index])
}
popupButton.menu = superMenu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Add the popupbutton in your code and you will get results like this
Each one will be having its own items inside.
answered Nov 20 '18 at 7:13
mouseymaniacmouseymaniac
1915
1915
At this point, anything is better than what I currently have. Thank you.
– Daniel P
Nov 20 '18 at 7:50
The menu is displaying perfectly, however whenever I select an item it defaults back to the first entry. :(
– Daniel P
Nov 24 '18 at 16:31
I figured it out. See my answer here: stackoverflow.com/questions/53465965/…
– Daniel P
Nov 25 '18 at 18:19
add a comment |
At this point, anything is better than what I currently have. Thank you.
– Daniel P
Nov 20 '18 at 7:50
The menu is displaying perfectly, however whenever I select an item it defaults back to the first entry. :(
– Daniel P
Nov 24 '18 at 16:31
I figured it out. See my answer here: stackoverflow.com/questions/53465965/…
– Daniel P
Nov 25 '18 at 18:19
At this point, anything is better than what I currently have. Thank you.
– Daniel P
Nov 20 '18 at 7:50
At this point, anything is better than what I currently have. Thank you.
– Daniel P
Nov 20 '18 at 7:50
The menu is displaying perfectly, however whenever I select an item it defaults back to the first entry. :(
– Daniel P
Nov 24 '18 at 16:31
The menu is displaying perfectly, however whenever I select an item it defaults back to the first entry. :(
– Daniel P
Nov 24 '18 at 16:31
I figured it out. See my answer here: stackoverflow.com/questions/53465965/…
– Daniel P
Nov 25 '18 at 18:19
I figured it out. See my answer here: stackoverflow.com/questions/53465965/…
– Daniel P
Nov 25 '18 at 18:19
add a comment |
If you don't have the group heading, you can use the following code
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let menu = NSMenu()
for item in items
{
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
}
popupButton.menu = menu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Result :
Your other answer works better.
– Daniel P
Nov 20 '18 at 15:53
I have updated the question with a picture with my current issue. Hopefully it'll make sense why your other answer is preferable.
– Daniel P
Nov 20 '18 at 15:58
add a comment |
If you don't have the group heading, you can use the following code
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let menu = NSMenu()
for item in items
{
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
}
popupButton.menu = menu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Result :
Your other answer works better.
– Daniel P
Nov 20 '18 at 15:53
I have updated the question with a picture with my current issue. Hopefully it'll make sense why your other answer is preferable.
– Daniel P
Nov 20 '18 at 15:58
add a comment |
If you don't have the group heading, you can use the following code
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let menu = NSMenu()
for item in items
{
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
}
popupButton.menu = menu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Result :
If you don't have the group heading, you can use the following code
let items = [["First","Second"],["First","Second"],["First","Second"]]
lazy var addNewViewButton : NSPopUpButton = {
let popupButton = NSPopUpButton()
let menu = NSMenu()
for item in items
{
for title in item
{
let menuItem = NSMenuItem(title: title, action: nil, keyEquivalent: "")
menuItem.target = self
menu.addItem(menuItem)
}
menu.addItem(NSMenuItem.separator())
}
popupButton.menu = menu
popupButton.translatesAutoresizingMaskIntoConstraints = false
return popupButton
}()
Result :
answered Nov 20 '18 at 8:37
mouseymaniacmouseymaniac
1915
1915
Your other answer works better.
– Daniel P
Nov 20 '18 at 15:53
I have updated the question with a picture with my current issue. Hopefully it'll make sense why your other answer is preferable.
– Daniel P
Nov 20 '18 at 15:58
add a comment |
Your other answer works better.
– Daniel P
Nov 20 '18 at 15:53
I have updated the question with a picture with my current issue. Hopefully it'll make sense why your other answer is preferable.
– Daniel P
Nov 20 '18 at 15:58
Your other answer works better.
– Daniel P
Nov 20 '18 at 15:53
Your other answer works better.
– Daniel P
Nov 20 '18 at 15:53
I have updated the question with a picture with my current issue. Hopefully it'll make sense why your other answer is preferable.
– Daniel P
Nov 20 '18 at 15:58
I have updated the question with a picture with my current issue. Hopefully it'll make sense why your other answer is preferable.
– Daniel P
Nov 20 '18 at 15:58
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53359751%2fis-it-possible-to-group-items-in-a-nspopupbutton%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
I don't think there's an off-the-shelf control like that. You should be able to build it using a table view though. (I work mostly in iOS these days so my Mac Cocoa is getting rusty.)
– Duncan C
Nov 18 '18 at 12:16
2
@DuncanC is right. Your second screenshot appears to be an
NSTableView
shown inside a modal sheet. So if that's what you're trying to replicate, that's where you should start.– TheNextman
Nov 18 '18 at 19:03
1
After further digging I found that no,
NSTableView
does not support sections. I found this link where somebody did the hard work: blog.krzyzanowskim.com/2015/05/29/…– Duncan C
Nov 19 '18 at 0:52
1
Well, it supports group rows: developer.apple.com/documentation/appkit/nstableviewdelegate/…. The API is not the same and not as nice as on iOS (
NSTableView
predatesUITableView
), and you could have a hard time depending on how your data is structured– TheNextman
Nov 19 '18 at 2:41
1
I checked with Accessibility Inspector, and the voice table in your second screenshot is an
NSTableView
– TheNextman
Nov 19 '18 at 2:45