package require sqlite3
package require Tk
#############################################################################
# Code to set up scrollbars for widgets. This is generic, boring stuff.
#
namespace import ::autoscroll::*
#############################################################################
set O(tree_sort) 0
::ttk::panedwindow .pan -orient horizontal
set O(tree)
frame .pan.right
set O(text)
button .pan.right.index -command -text "Show Index"
pack .pan.right.index -side top -fill x
pack .pan.right.text -fill both -expand true
$O(text) tag configure highlight -background wheat
$O(text) configure -wrap none -height 35
.pan add .pan.tree
.pan add .pan.right
$O(tree) configure -columns
$O(tree) heading #0 -text Line -anchor w -command
$O(tree) heading calls -text Calls -anchor w -command
$O(tree) heading bytes -text Bytes -anchor w -command
$O(tree) column #0 -width 150
$O(tree) column calls -width 100
$O(tree) column bytes -width 100
pack .pan -fill both -expand 1
#--------------------------------------------------------------------
# Open the database containing the malloc data. The user specifies the
# database to use by passing the file-name on the command line.
#
open_database
bind $O(tree) <<TreeviewSelect>>
populate_tree_widget mddb