cocoa: update syntax

modern-harvey2
Doug Coleman 2018-01-27 10:38:35 -06:00
parent 5d8b912216
commit 06dd84bc69
4 changed files with 13 additions and 17 deletions

View File

@ -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 ;

View File

@ -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

View File

@ -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*

View File

@ -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? [