X-Git-Url: http://git.annexia.org/?p=libguestfs-talks.git;a=blobdiff_plain;f=2019-fosdem%2Fnbdview%2Fnbdview.tcl;h=0e876906009522e77ec6af7198e64de71c614cef;hp=fa6343e55406023f4e9d60617fd5d55800c86696;hb=HEAD;hpb=7fa686e481dcca96f185aea00e75d4f6df6506b8 diff --git a/2019-fosdem/nbdview/nbdview.tcl b/2019-fosdem/nbdview/nbdview.tcl index fa6343e..0e87690 100755 --- a/2019-fosdem/nbdview/nbdview.tcl +++ b/2019-fosdem/nbdview/nbdview.tcl @@ -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.