1 ! Copyright (C) 2006, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors continuations kernel models namespaces
4 prettyprint ui ui.commands ui.gadgets ui.gadgets.labelled assocs
5 ui.gadgets.tracks ui.gadgets.buttons ui.gadgets.panes
6 ui.gadgets.status-bar ui.gadgets.scrollers ui.gestures sequences
11 : <callstack-display> ( model -- gadget )
12 [ [ call>> callstack. ] when* ]
13 t "Call stack" <labelled-pane> ;
15 : <datastack-display> ( model -- gadget )
16 [ [ data>> stack. ] when* ]
17 t "Data stack" <labelled-pane> ;
19 : <retainstack-display> ( model -- gadget )
20 [ [ retain>> stack. ] when* ]
21 t "Retain stack" <labelled-pane> ;
23 TUPLE: traceback-gadget < track ;
25 M: traceback-gadget pref-dim* drop { 550 600 } ;
27 : <traceback-gadget> ( model -- gadget )
28 { 0 1 } traceback-gadget new-track
33 over <datastack-display> 1/2 track-add
34 swap <retainstack-display> 1/2 track-add
37 dup model>> <callstack-display> 2/3 track-add
41 : <namestack-display> ( model -- gadget )
42 [ [ name>> namestack. ] when* ]
45 : <variables-gadget> ( model -- gadget )
49 { 400 400 } >>max-dim ;
51 : variables ( traceback -- )
52 model>> <variables-gadget>
53 "Dynamic variables" open-status-window ;
55 : traceback-window ( continuation -- )
56 <model> <traceback-gadget> "Traceback" open-status-window ;