flamegraphs: Improve the title page
[libguestfs-talks.git] / 2019-fosdem / nbdview / nbdview.tcl
index fa6343e..0e87690 100755 (executable)
@@ -37,7 +37,7 @@ source "nbdcanvas.tcl"
 
 set blocksize 4096
 set width 128
-set scale 2
+set scale 4
 
 # This is used to store the canvas handle.
 set h ""
@@ -59,9 +59,6 @@ if { $argc != 2 } {
 set logfile [lindex $argv 0]
 set size [lindex $argv 1]
 
-# Set up the window.
-wm title . "nbdview $logfile"
-
 # Menubar.
 option add *tearOff 0
 menu .menubar
@@ -70,14 +67,18 @@ menu .menubar.file
 .menubar add cascade -menu .menubar.file -label File
 .menubar.file add command -label "Quit" -command { exit }
 
+# Frame.
+frame .f
+pack .f -anchor center -expand 1 -fill both -ipadx 10 -ipady 10
+
 # Canvas.
-set h [nbdcanvas .c $logfile $size $blocksize $width $scale]
-pack .c -in . -expand 1 -fill both
+set h [nbdcanvas .f.c $logfile $size $blocksize $width $scale]
+.f.c configure -borderwidth 4 -relief groove
+pack .f.c -anchor center -expand 0 -fill none
 
-# Set the width and height of the window.
-set h_ [expr {[nbdheight $h] * $scale + 40}]
-set w [expr {$width * $scale + 16}]
-wm geometry . "${w}x${h_}"
+# Set up the window.
+wm attributes . -topmost 1
+wm title . "nbdview $logfile"
 wm resizable . false false
 
 # Start polling the log file.