From 0b7def29352a9ec3fe79c13baf8a2611036a7751 Mon Sep 17 00:00:00 2001 From: slava Date: Mon, 27 Nov 2006 00:46:49 +0000 Subject: [PATCH] Minor usability improvement for operations --- TODO.FACTOR.txt | 2 -- library/ui/tools/operations.factor | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index d327724073..de932ebb18 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,8 +1,6 @@ + 0.87: - better error handling in early startup -- some module operations don't work on module-links -- list operations: what if nothing is selected? - slider needs to be modelized - overhaul models, set-model* is crap - color picker example diff --git a/library/ui/tools/operations.factor b/library/ui/tools/operations.factor index c42c7845ae..9e6ff6079e 100644 --- a/library/ui/tools/operations.factor +++ b/library/ui/tools/operations.factor @@ -13,8 +13,12 @@ V{ } clone operations set-global operations get push-new ; M: operation invoke-command ( target operation -- ) - dup command-quot swap operation-listener? - [ curry call-listener ] [ call ] if ; + 2dup operation-predicate call [ + dup command-quot swap operation-listener? + [ curry call-listener ] [ call ] if + ] [ + 2drop + ] if ; : modify-listener-operation ( quot operation -- operation ) clone t over set-operation-listener?