From 3aac5a6591f95729a6ed71b7edfceec6324d79b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Tue, 27 Jun 2017 23:29:52 +0200 Subject: [PATCH] ui: more docs and tests --- basis/ui/backend/backend-docs.factor | 5 +++++ basis/ui/event-loop/event-loop-docs.factor | 6 ++++++ basis/ui/gadgets/worlds/worlds-docs.factor | 4 ++++ basis/ui/tools/debugger/debugger-tests.factor | 7 +++++++ basis/ui/tools/debugger/debugger.factor | 2 +- 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 basis/ui/backend/backend-docs.factor create mode 100644 basis/ui/event-loop/event-loop-docs.factor create mode 100644 basis/ui/tools/debugger/debugger-tests.factor diff --git a/basis/ui/backend/backend-docs.factor b/basis/ui/backend/backend-docs.factor new file mode 100644 index 0000000000..147fb4aece --- /dev/null +++ b/basis/ui/backend/backend-docs.factor @@ -0,0 +1,5 @@ +USING: help.markup help.syntax ; +IN: ui.backend + +HELP: stop-event-loop +{ $description "Called by the UI to tell the backend to stop itself. Only needed by the GTK backend that otherwise gets stuck in 'gtk_main'." } ; diff --git a/basis/ui/event-loop/event-loop-docs.factor b/basis/ui/event-loop/event-loop-docs.factor new file mode 100644 index 0000000000..a262911149 --- /dev/null +++ b/basis/ui/event-loop/event-loop-docs.factor @@ -0,0 +1,6 @@ +USING: help.markup help.syntax kernel ; +IN: ui.event-loop + +HELP: event-loop? +{ $values { "?" boolean } } +{ $description { $link t } " if there is active windows." } ; diff --git a/basis/ui/gadgets/worlds/worlds-docs.factor b/basis/ui/gadgets/worlds/worlds-docs.factor index c92fc98fa6..19c63a8c57 100644 --- a/basis/ui/gadgets/worlds/worlds-docs.factor +++ b/basis/ui/gadgets/worlds/worlds-docs.factor @@ -128,6 +128,10 @@ HELP: draw-world* { $values { "world" world } } { $description "Called when " { $snippet "world" } " needs to be redrawn. The world's OpenGL context is current when this method is called." } ; +HELP: ui-error-hook +{ $var-description "A quotation that is called if an error occurs in the UI updating thread." } +{ $see-also ui-error } ; + ARTICLE: "ui.gadgets.worlds-subclassing" "Subclassing worlds" "The " { $link world } " gadget can be subclassed, giving Factor code full control of the window's OpenGL context. The following generic words can be overridden to replace standard UI behavior:" { $subsections diff --git a/basis/ui/tools/debugger/debugger-tests.factor b/basis/ui/tools/debugger/debugger-tests.factor new file mode 100644 index 0000000000..d0622b30af --- /dev/null +++ b/basis/ui/tools/debugger/debugger-tests.factor @@ -0,0 +1,7 @@ +USING: kernel tools.test ui.gadgets.worlds ui.tools.debugger ; +IN: ui.tools.debugger.tests + + +{ f } [ + f world-error boa error-in-debugger? +] unit-test diff --git a/basis/ui/tools/debugger/debugger.factor b/basis/ui/tools/debugger/debugger.factor index 01bdaff61e..8425b9249f 100644 --- a/basis/ui/tools/debugger/debugger.factor +++ b/basis/ui/tools/debugger/debugger.factor @@ -64,7 +64,7 @@ M: debugger focusable-child* GENERIC: error-in-debugger? ( error -- ? ) M: world-error error-in-debugger? - world>> children>> [ f ] [ first debugger? ] if-empty ; + world>> children>> ?first debugger? ; M: object error-in-debugger? drop f ;