cocoa.touchbar: try this.

factor-shell
John Benediktsson 2018-01-26 16:48:12 -08:00
parent 10a3af39da
commit f976d97983
1 changed files with 4 additions and 4 deletions

View File

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