Revert "cocoa.touchbar: try this."

This reverts commit f976d97983.
factor-shell
John Benediktsson 2018-01-28 11:21:23 -08:00
parent 26b6a378ac
commit f0347b71cf
1 changed files with 4 additions and 4 deletions

View File

@ -7,17 +7,17 @@ IN: cocoa.touchbar
: make-touchbar ( seq self -- touchbar )
[ NSTouchBar -> alloc -> init dup ] dip -> setDelegate: {
[ swap <CFStringArray> -> setDefaultItemIdentifiers: ]
[ swap <CFStringArray> -> setCustomizationAllowedItemIdentifiers: ]
[ swap <CFStringArray> { void { id SEL id } } ?-> setDefaultItemIdentifiers: ]
[ swap <CFStringArray> { void { id SEL id } } ?-> setCustomizationAllowedItemIdentifiers: ]
[ nip ]
} 2cleave ;
:: make-NSTouchBar-button ( self identifier label-string action-string -- button )
NSCustomTouchBarItem -> alloc
identifier <CFString> -> initWithIdentifier: :> item
identifier <CFString> { id { id SEL id } } ?-> initWithIdentifier: :> item
NSButton
label-string <CFString>
self
action-string lookup-selector -> buttonWithTitle:target:action: :> button
action-string lookup-selector { id { id SEL id id SEL } } ?-> buttonWithTitle:target:action: :> button
item button -> setView:
item ;