ui.backend: adding ui-stop-after-last-window?.
This defaults to true, except for the "ui.tools". Also, this only works on macOS right now. Linux and Windows always stop after the last window closes.char-rename
parent
44da4ed4dd
commit
96a0c30baf
|
@ -5,6 +5,9 @@ IN: ui.backend
|
||||||
|
|
||||||
SYMBOL: ui-backend
|
SYMBOL: ui-backend
|
||||||
|
|
||||||
|
SYMBOL: ui-stop-after-last-window?
|
||||||
|
ui-stop-after-last-window? [ t ] initialize
|
||||||
|
|
||||||
HOOK: set-title ui-backend ( string world -- )
|
HOOK: set-title ui-backend ( string world -- )
|
||||||
|
|
||||||
HOOK: (set-fullscreen) ui-backend ( world ? -- )
|
HOOK: (set-fullscreen) ui-backend ( world ? -- )
|
||||||
|
|
|
@ -196,7 +196,12 @@ M: cocoa-ui-backend system-alert
|
||||||
] [ 2drop ] if* ;
|
] [ 2drop ] if* ;
|
||||||
|
|
||||||
CLASS: FactorApplicationDelegate < NSObject
|
CLASS: FactorApplicationDelegate < NSObject
|
||||||
|
|
||||||
METHOD: void applicationDidUpdate: id obj [ reset-thread-timer ] ;
|
METHOD: void applicationDidUpdate: id obj [ reset-thread-timer ] ;
|
||||||
|
|
||||||
|
METHOD: char applicationShouldTerminateAfterLastWindowClosed: id app [
|
||||||
|
ui-stop-after-last-window? get 1 0 ?
|
||||||
|
] ;
|
||||||
;
|
;
|
||||||
|
|
||||||
: install-app-delegate ( -- )
|
: install-app-delegate ( -- )
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
! Copyright (C) 2006, 2009 Slava Pestov.
|
! Copyright (C) 2006, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: memory system ui ui.commands ui.gestures ui.tools.browser
|
USING: memory namespaces system ui ui.backend ui.commands
|
||||||
ui.tools.common ui.tools.error-list ui.tools.listener
|
ui.gestures ui.tools.browser ui.tools.common
|
||||||
vocabs.refresh ;
|
ui.tools.error-list ui.tools.listener vocabs.refresh ;
|
||||||
IN: ui.tools
|
IN: ui.tools
|
||||||
|
|
||||||
MAIN: listener-window
|
|
||||||
|
|
||||||
\ refresh-all H{ { +nullary+ t } { +listener+ t } } define-command
|
\ refresh-all H{ { +nullary+ t } { +listener+ t } } define-command
|
||||||
|
|
||||||
\ save H{ { +nullary+ t } } define-command
|
\ save H{ { +nullary+ t } } define-command
|
||||||
|
@ -29,3 +27,9 @@ tool "common" f {
|
||||||
{ T{ key-down f f "F2" } refresh-all }
|
{ T{ key-down f f "F2" } refresh-all }
|
||||||
{ T{ key-down f f "F3" } show-error-list }
|
{ T{ key-down f f "F3" } show-error-list }
|
||||||
} define-command-map
|
} define-command-map
|
||||||
|
|
||||||
|
: ui-tools-main ( -- )
|
||||||
|
f ui-stop-after-last-window? set-global
|
||||||
|
listener-window ;
|
||||||
|
|
||||||
|
MAIN: ui-tools-main
|
||||||
|
|
Loading…
Reference in New Issue