git.annexia.org
/
libguestfs-talks.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update nbdview.
[libguestfs-talks.git]
/
2019-fosdem
/
nbdview
/
nbdview.tcl
diff --git
a/2019-fosdem/nbdview/nbdview.tcl
b/2019-fosdem/nbdview/nbdview.tcl
index
fa6343e
..
9e41014
100755
(executable)
--- 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 blocksize 4096
set width 128
-set scale
2
+set scale
4
# This is used to store the canvas handle.
set h ""
# 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 logfile [lindex $argv 0]
set size [lindex $argv 1]
-# Set up the window.
-wm title . "nbdview $logfile"
-
# Menubar.
option add *tearOff 0
menu .menubar
# Menubar.
option add *tearOff 0
menu .menubar
@@
-70,14
+67,17
@@
menu .menubar.file
.menubar add cascade -menu .menubar.file -label File
.menubar.file add command -label "Quit" -command { exit }
.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.
# 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 title . "nbdview $logfile"
wm resizable . false false
# Start polling the log file.
wm resizable . false false
# Start polling the log file.