cocoa: update syntax
parent
5d8b912216
commit
06dd84bc69
|
@ -6,18 +6,18 @@ cocoa.runtime combinators core-foundation.strings kernel locals
|
|||
IN: cocoa.touchbar
|
||||
|
||||
: make-touchbar ( seq self -- touchbar )
|
||||
[ NSTouchBar -> alloc -> init dup ] dip -> setDelegate: {
|
||||
[ swap <CFStringArray> -> setDefaultItemIdentifiers: ]
|
||||
[ swap <CFStringArray> -> setCustomizationAllowedItemIdentifiers: ]
|
||||
[ NSTouchBar send: alloc send: init dup ] dip send: setDelegate: {
|
||||
[ swap <CFStringArray> send: setDefaultItemIdentifiers: ]
|
||||
[ swap <CFStringArray> send: setCustomizationAllowedItemIdentifiers: ]
|
||||
[ nip ]
|
||||
} 2cleave ;
|
||||
|
||||
:: make-NSTouchBar-button ( self identifier label-string action-string -- button )
|
||||
NSCustomTouchBarItem -> alloc
|
||||
identifier <CFString> -> initWithIdentifier: :> item
|
||||
NSCustomTouchBarItem send: alloc
|
||||
identifier <CFString> send: initWithIdentifier: :> item
|
||||
NSButton
|
||||
label-string <CFString>
|
||||
self
|
||||
action-string lookup-selector -> buttonWithTitle:target:action: :> button
|
||||
item button -> setView:
|
||||
action-string lookup-selector send: buttonWithTitle:target:action: :> button
|
||||
item button send: setView:
|
||||
item ;
|
||||
|
|
|
@ -76,10 +76,10 @@ M: pasteboard set-clipboard-contents
|
|||
! after register-window.
|
||||
dup { 0 0 } = [
|
||||
drop
|
||||
worlds get-global length 1 <= [ -> center ] [
|
||||
worlds get-global length 1 <= [ send: center ] [
|
||||
worlds get-global last second window-loc>>
|
||||
dupd first2 <CGPoint> -> \cascadeTopLeftFromPoint:
|
||||
-> \setFrameTopLeftPoint:
|
||||
dupd first2 <CGPoint> send: \cascadeTopLeftFromPoint:
|
||||
send: \setFrameTopLeftPoint:
|
||||
] if
|
||||
] [ first2 <CGPoint> send: \setFrameTopLeftPoint: ] if ;
|
||||
|
||||
|
@ -222,13 +222,9 @@ M: cocoa-ui-backend (with-ui)
|
|||
stop-io-thread
|
||||
init-thread-timer
|
||||
reset-thread-timer
|
||||
<<<<<<< HEAD
|
||||
NSApp send: run
|
||||
] ui-running
|
||||
=======
|
||||
NSApp -> run
|
||||
NSApp send: run
|
||||
] with-ui-running
|
||||
>>>>>>> origin/master
|
||||
] with-cocoa ;
|
||||
|
||||
cocoa-ui-backend ui-backend set-global
|
||||
|
|
|
@ -221,7 +221,7 @@ M: send-touchbar-command send-queued-gesture
|
|||
|
||||
METHOD: Class touchBar: Class touchbar makeItemForIdentifier: Class string [
|
||||
touchbar-commands drop [
|
||||
[ self string CF>string dup string>number ] dip nth
|
||||
[ self string CFString>string dup string>number ] dip nth
|
||||
second name>> "com-" ?head drop over
|
||||
"touchBarCommand" prepend make-NSTouchBar-button
|
||||
] [ f ] if*
|
||||
|
|
|
@ -86,7 +86,7 @@ M: word-completion row-color
|
|||
[ color: dark-gray ]
|
||||
} cond 2nip ;
|
||||
|
||||
M: vocab-word-completion row-color 2drop COLOR: black ;
|
||||
M: vocab-word-completion row-color 2drop color: black ;
|
||||
|
||||
M: vocab-completion row-color
|
||||
drop dup vocab? [
|
||||
|
|
Loading…
Reference in New Issue