NSOutlineView with an unread message icon such as Mail.app

I'm trying to create a user interface that looks like a list of iTunes sources or a list of Mail.app mailboxes, which displays a number icon to the right of the item (for example, unread emails, new podcasts).

Based on the Apple SourceList example, I have NSOutlineViewto display multiple groups and multiple items in each group.

Is there a standard user interface element for representing an “icon” with a number for each entry? I could not find anything in the documents. I suspect that I will have to stretch NSTextFieldCelland make the drawing itself.

Are there any examples of how to do this?

+3
source share
3 answers

I used PXSourceListfrom @Perspx and found that it is great for doing exactly what you want.

+4
source

Apple has an example code in which they implement an unread icon using a rounded rectangular button.

See Sidebar Demo .

+2
source

Since the object library has a special built-in button:

enter image description here

0
source

Source: https://habr.com/ru/post/1767652/


All Articles