OS X Touchbar: your help needed
Still playing with OS X Touchbar, I am hitting a thick wall: the 10.2.1 Release Notes read:
NSTouchBarsupports a text-related item identifier,
NSTouchBarItemIdentifierCharacterPicker, and returns an
NSPopoverTouchBarItemconfigured to show the system character picker from
That Character Picker (that is more an Emoji Picker) is easily visible for instance with a Compose Window of Apple Mail:
You can see there, from right to left, a scrubber with the most frequently used emojis, a label, and a popover button that allows access to the various categories of emojis and their contents. All in all, it's very well done.
But if I try to programmatically add a
NSTouchBarItemIdentifierCharacterPicker to a touchbar that is not linked to a
NSTextView or a
NSTextField, I end up with a horked, partial, result. The popover button is correct but when you click on it...
As you can see, there is only the list of favorites emojis (in fact the last used emojis), it does not scroll and its width/height seems wrong, the label is gone, and the emoji picker is completely gone... And whatever I do, I end up with the same result. Through lldb, I have dived into the touchbar: the CharacterPicker popover has the correct PopoverButtonItem and its associated popoverTouchBar only contains one element that has the
Seen from here, there are only two possibilities:
- I am missing a parameter, an attribute, a whatever somewhere. That's not surprising given how superficial (to remain polite) the documentation is about this. The paragraph quoted above is the ONLY thing you can find about the CharacterPicker...
- there is a bug somewhere in Apple's code and Apple's own code works around it but it's totally impossible for me to find out what's going on here...
If you work at Apple or are a Touchbar expert and think you can help, please leave a comment here. This is true blocker to me and all the various approaches I tried to create the touchbar (manually created, dynamic, creating items, using only identifiers) lead to exactly the same horked result above. Thanks!
Addendum: OS X 10.12.4, Xcode 8.3 (8E162).