! Copyright (C) 2006, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors continuations kernel models namespaces prettyprint ui ui.commands ui.gadgets ui.gadgets.labelled assocs ui.gadgets.tracks ui.gadgets.buttons ui.gadgets.panes ui.gadgets.status-bar ui.gadgets.scrollers ui.gestures sequences inspector models.filter ; QUALIFIED-WITH: ui.tools.inspector i IN: ui.tools.traceback : ( model -- gadget ) [ [ call>> callstack. ] when* ] t "Call stack" ; : ( model -- gadget ) [ [ data>> stack. ] when* ] t "Data stack" ; : ( model -- gadget ) [ [ retain>> stack. ] when* ] t "Retain stack" ; TUPLE: traceback-gadget < track ; M: traceback-gadget pref-dim* drop { 550 600 } ; : ( model -- gadget ) [ vertical traceback-gadget new-track ] dip [ >>model ] [ [ horizontal ] dip [ 1/2 track-add ] [ 1/2 track-add ] bi 1/3 track-add ] [ 2/3 track-add ] tri add-toolbar ; : variables ( traceback -- ) model>> [ dup [ name>> vars-in-scope ] when ] i:inspect-model ; : traceback-window ( continuation -- ) "Traceback" open-status-window ; : inspect-continuation ( traceback -- ) control-value i:inspector ; traceback-gadget "toolbar" f { { T{ key-down f f "v" } variables } { T{ key-down f f "n" } inspect-continuation } } define-command-map