if {[winfo containing $rootX $rootY] eq $w} {
set index [$w index @$x,$y]
if {$index != $state(drag_under)} {
- puts "moved to $index"
place $state(drag_indic) -anchor nw -x $x -y 0
set state(drag_under) $index
}
event generate $tab <<DetachedTab>>
}
proc ::ButtonNotebook::Debug {notebook msg} {
- $notebook.page0.text insert end $msg\n {}
- $notebook.page0.text see end
+ if {[winfo exists $notebook.page0.text]} {
+ $notebook.page0.text insert end $msg\n {}
+ $notebook.page0.text see end
+ }
}
# Attach a toplevel to the notebook
}
::ButtonNotebook::Init 1
-if {[winfo class .] eq "Tab"} {::ButtonNotebook::Test; tkwait window .}
\ No newline at end of file
+
+# The following line causes the Test procedure to be run if this file
+# is run standalone.
+if {[winfo class .] eq "Tab"} {::ButtonNotebook::Test; tkwait window .}