+- print-quot -- present commands directly
- auto-invoke code gc
- fix alien-callback/SEH bug on win32
+ ui:
+- control delegating to a pane is wrong
- the mouse button overload sucks, use popup menus instead
- nested presentation mouse over is not right
- ui quick start doc
"The prettyprinter (see " { $link "prettyprint" } ") can turn any object into a source representation. Sometimes this source representation is hard to read for a human, so the inspector provides an alternative tabular view of an object:"
{ $subsection inspect }
"The inspector supports a number of commands which operate on the most recently inspected object:"
-{ $subsection inspecting }
+{ $subsection me }
{ $subsection go }
{ $subsection up }
"Word for getting very brief descriptions of words and general objects:"
: write-outliner ( str obj content -- )
outline associate [ write-object ] with-nesting ;
-: print-input ( string input -- )
- <input> presented associate
- [ H{ { font-style bold } } format ] with-nesting
+: (print-input/quot)
+ associate [ H{ { font-style bold } } format ] with-nesting
terpri ;
+
+: print-input ( string input -- )
+ <input> presented (print-input/quot) ;
+
+: print-quot ( string quot -- )
+ quotation (print-input/quot) ;
: restart. ( restart n -- )
[ [ # " :res " % first % ] "" make ] keep
- [ :res ] curry print-input ;
+ [ :res ] curry print-quot ;
: restarts. ( -- )
restarts get dup empty? [
terpri
"Debugger commands:" print
terpri
- ":help - documentation for this error" [ :help ] print-input
- ":s - data stack at exception time" [ :s ] print-input
- ":r - retain stack at exception time" [ :r ] print-input
- ":c - call stack at exception time" [ :c ] print-input
+ ":help - documentation for this error" [ :help ] print-quot
+ ":s - data stack at exception time" [ :s ] print-quot
+ ":r - retain stack at exception time" [ :r ] print-quot
+ ":c - call stack at exception time" [ :c ] print-quot
error get [ parse-error? ] is? [
- ":edit - jump to source location" [ :edit ] print-input
+ ":edit - jump to source location" [ :edit ] print-quot
] when
":get ( var -- value ) accesses variables at time of the error" print
SYMBOL: inspector-stack
-: inspecting ( -- obj ) inspector-stack get peek ;
+: me ( -- obj ) inspector-stack get peek ;
: (inspect) ( obj -- )
dup inspector-stack get push
: inspector-help ( -- )
"Object inspector." print
- "up -- return to previous object" [ up ] print-input
- "inspecting ( -- obj ) push current object" [ inspecting ] print-input
+ "up -- return to previous object" [ up ] print-quot
+ "me ( -- obj ) push this object" [ me ] print-quot
"go ( n -- ) inspect nth slot" print
terpri ;
{ $var-description "If the inspector is running, this variable holds previously-inspected objects." }
{ $see-also go up } ;
-HELP: inspecting
+HELP: me
{ $description "If the inspector is running, outputs the object currently being inspected." } ;
HELP: inspector
{ $values { "obj" "an object" } }
{ $description "Starts a new inspector and prints a brief help message. If an inspector is already running, this starts a nested inspector. An alternative word that reuses the current inspector instance is " { $link inspect } "." }
-{ $see-also go up inspecting } ;
+{ $see-also go up me } ;
HELP: inspect
{ $values { "obj" "an object" } }
{ $description "If an inspector is already running, displays the slots of the object in the current inspector. If an inspector is not running, starts a new inspector." }
-{ $see-also go up inspecting } ;
+{ $see-also go up me } ;
HELP: go
{ $values { "n" "a non-negative integer" } }
{ "id" "SEL" "id" "id" "void*" }
[
nip
- [ <input> listener-gadget call-tool f ]
+ [ call-listener f ]
do-service
2drop
]
M: listener-gadget focusable-child*
listener-gadget-input ;
-: listener-available? ( gadget -- ? )
- dup listener-gadget? [
- listener-gadget-input interactor-busy? not
- ] [
- drop f
- ] if ;
-
-G: call-listener ( quot/string listener -- )
- 1 standard-combination ;
-
-M: quotation call-listener
- listener-gadget-input interactor-call ;
-
-M: string call-listener
- listener-gadget-input set-editor-text ;
-
-M: input call-listener
- >r input-string r> call-listener ;
-
-M: listener-gadget call-tool* ( quot/string listener -- )
- call-listener ;
+M: listener-gadget call-tool* ( input listener -- )
+ >r input-string r> listener-gadget-input set-editor-text ;
M: listener-gadget tool-scroller
listener-gadget-output find-scroller ;
M: listener-gadget tool-help
drop "ui-listener" ;
+: find-listener ( -- listener )
+ listener-gadget find-workspace show-tool tool-gadget ;
+
+: call-listener ( quot -- )
+ find-listener listener-gadget-input interactor-call ;
+
: listener-run-files ( seq -- )
dup empty? [
drop
] [
- [ [ run-file ] each ] curry listener-gadget call-tool
+ [ [ run-file ] each ] curry call-listener
] if ;
: listener-eof ( listener -- )
M: operation invoke-command ( target operation -- )
dup command-quot swap operation-listener?
- [ curry listener-gadget call-tool ] [ call ] if ;
+ [ curry call-listener ] [ call ] if ;
: modify-operation ( quot operation -- operation )
clone
: walker-inspect ( walker -- )
walker-gadget-ns [ meta-interp get ] bind
- [ inspect ] curry listener-gadget call-tool ;
+ [ inspect ] curry call-listener ;
: walker-step-all ( walker -- )
dup [ step-all ] walker-command reset-walker
} define-commands
workspace "Workflow commands" {
- { "Reload changed sources" T{ key-down f f "F8" } [ drop [ reload-modules ] listener-gadget call-tool ] }
- { "Recompile changed words" T{ key-down f { S+ } "F8" } [ drop [ recompile ] listener-gadget call-tool ] }
+ { "Reload changed sources" T{ key-down f f "F8" } [ drop [ reload-modules ] call-listener ] }
+ { "Recompile changed words" T{ key-down f { S+ } "F8" } [ drop [ recompile ] call-listener ] }
} define-commands
M: world pref-dim*
delegate pref-dim* [ >fixnum ] map { 1024 768 } vmin ;
-: activate-world-model ( world model -- )
- [ add-connection ] keep activate-model ;
-
M: world graft*
- dup dup world-title activate-world-model
- dup dup world-status activate-world-model
+ dup dup world-title add-connection
+ dup dup world-status add-connection
model-changed ;
-: deactivate-world-model ( world model -- )
- [ remove-connection ] keep deactivate-model ;
-
M: world ungraft*
dup
- dup world-title deactivate-world-model
- dup world-status deactivate-world-model ;
+ dup world-title remove-connection
+ dup world-status remove-connection ;
M: world model-changed
dup world-title model-value swap set-title ;