▼ |  | Framework: Racket GUI Application Framework

1 | Framework Libraries Overview
2 | Application
3 | Autosave
4 | Canvas
5 | Color Model
6 | Color Prefs
7 | Color
8 | Comment Box
9 | Decorated Editor Snip
10 | Editor Snip
11 | Editor
12 | Exit
13 | Finder
14 | Frame
15 | Group
16 | GUI Utilities
17 | Handler
18 | Icon
19 | Keymap
20 | Menu
21 | Mode
22 | Number Snip
23 | Panel
24 | Pasteboard
25 | Path Utils
26 | Preferences
27 | Preferences, Textual
28 | Racket
29 | Text
30 | Splash
31 | Test
32 | Version
33 | Backwards Compatibility
34 | Signatures
35 | Unit
| Index

On this page:

exit: exiting?
exit: set-exiting
exit: insert-on-callback
exit: insert-can?-callback
exit: can-exit?
exit: on-exit
exit: exit
exit: user-oks-exit

top ← prev up next →

### 12`` Exit

> > procedure

> > ( exit:exiting? ) → boolean?

Returns #t to indicate that an exit operation is taking place. Does not indicate that the app will actually exit, since the user may cancel the exit.

See also exit:insert-on-callback and exit:insert-can?-callback.

> > procedure

> > ( exit:set-exiting exiting?) → void?

> exiting? : boolean?

Sets a flag that affects the result of exit:exiting?.

> > procedure

> > ( exit:insert-on-callback callback) → ( -> void? )

> callback : ( -> void? )

Adds a callback to be called when exiting. This callback must not fail. If a callback should stop an exit from happening, use exit:insert-can?-callback.

> > procedure

> > ( exit:insert-can?-callback callback) → ( -> void? )

> callback : ( -> boolean? )

Use this function to add a callback that determines if an attempted exit can proceed. This callback should not clean up any state, since another callback may veto the exit. Use exit:insert-on-callback for callbacks that clean up state.

> > procedure

> > ( exit:can-exit? ) → boolean?

Calls the “can-callbacks” and returns their results. See exit:insert-can?-callback for more information.

> > procedure

> > ( exit:on-exit ) → void?

Calls the “on-callbacks”. See exit:insert-on-callback for more information.

> > procedure

> > ( exit:exit ) → any

exit:exit performs four actions:

- sets the result of the exit:exiting? function to #t.

- invokes the exit-callbacks, with exit:can-exit? if none of the “can?” callbacks return #f,

- invokes exit:on-exit and then

- queues a callback that calls exit (a racket procedure) and (if exit returns) sets the result of exit:exiting? back to #t.

> > procedure

> > ( exit:user-oks-exit ) → boolean?

Opens a dialog that queries the user about exiting. Returns the user’s decision.
top ← prev up next →