]> gitweb.factorcode.org Git - factor.git/commitdiff
ui: more docs and tests
authorBjörn Lindqvist <bjourne@gmail.com>
Tue, 27 Jun 2017 21:29:52 +0000 (23:29 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Tue, 27 Jun 2017 21:47:35 +0000 (23:47 +0200)
basis/ui/backend/backend-docs.factor [new file with mode: 0644]
basis/ui/event-loop/event-loop-docs.factor [new file with mode: 0644]
basis/ui/gadgets/worlds/worlds-docs.factor
basis/ui/tools/debugger/debugger-tests.factor [new file with mode: 0644]
basis/ui/tools/debugger/debugger.factor

diff --git a/basis/ui/backend/backend-docs.factor b/basis/ui/backend/backend-docs.factor
new file mode 100644 (file)
index 0000000..147fb4a
--- /dev/null
@@ -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 (file)
index 0000000..a262911
--- /dev/null
@@ -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." } ;
index c92fc98fa61f24e94fd87434cea1f8df3315273a..19c63a8c575c486c7244037fb7fd7b93faab1e84 100644 (file)
@@ -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 (file)
index 0000000..d0622b3
--- /dev/null
@@ -0,0 +1,7 @@
+USING: kernel tools.test ui.gadgets.worlds ui.tools.debugger ;
+IN: ui.tools.debugger.tests
+
+
+{ f } [
+    f <world-attributes> <world> world-error boa error-in-debugger?
+] unit-test
index 01bdaff61eb8acd9324a1700441d1819ed785cb7..8425b9249fc3c3b5856831f354fe3dccb595799f 100644 (file)
@@ -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 ;