[Tkabber-dev] r1120 - in trunk/tkabber: . ifacetk

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Apr 19 09:58:31 MSD 2007


Author: sergei
Date: 2007-04-19 09:58:30 +0400 (Thu, 19 Apr 2007)
New Revision: 1120

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/ifacetk/buttonbar.tcl
   trunk/tkabber/ifacetk/iface.tcl
Log:
	* ifacetk/buttonbar.tcl: Fixed displaying vertical tabbar. Before
	  that it might be wider than required and under certain conditions
	  there was an infinite <Configure> event loop.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-04-18 18:48:01 UTC (rev 1119)
+++ trunk/tkabber/ChangeLog	2007-04-19 05:58:30 UTC (rev 1120)
@@ -1,3 +1,9 @@
+2007-04-19  Sergei Golovan  <sgolovan at nes.ru>
+
+	* ifacetk/buttonbar.tcl: Fixed displaying vertical tabbar. Before
+	  that it might be wider than required and under certain conditions
+	  there was an infinite <Configure> event loop.
+
 2007-04-18  Sergei Golovan  <sgolovan at nes.ru>
 
 	* ifacetk/buttonbar.tcl, ifacetk/iface.tcl, ifacetk/systray.tcl,

Modified: trunk/tkabber/ifacetk/buttonbar.tcl
===================================================================
--- trunk/tkabber/ifacetk/buttonbar.tcl	2007-04-18 18:48:01 UTC (rev 1119)
+++ trunk/tkabber/ifacetk/buttonbar.tcl	2007-04-19 05:58:30 UTC (rev 1120)
@@ -70,7 +70,9 @@
 
     set res [Widget::configure $path $args]
 
-    if {[Widget::hasChanged $path -orient val]} {
+    if {[Widget::hasChanged $path -orient val] || \
+	[Widget::hasChanged $path -minwidth val] || \
+	[Widget::hasChanged $path -maxwidth val]} {
 	_redraw $path
     }
 
@@ -393,6 +395,9 @@
 	set th 0
 	set num 0
 	foreach name $data(buttons) {
+	    _reconfigure_text $path $name
+	}
+	foreach name $data(buttons) {
 	    set but [_but $path $name]
 
 	    if {[info exists data(height,$name)]} {
@@ -545,6 +550,7 @@
     variable $path
     upvar 0  $path data
 
+
     if {![info exists data(text,$name)]} return
 
     set but [_but $path $name]
@@ -554,17 +560,26 @@
     set hl   [_itemoption $path $name -highlightthickness]
 
     set w [winfo width $but]
+    set min [Widget::getoption $path -minwidth]
+    set max [Widget::getoption $path -maxwidth]
+    if {$min > $max} {
+	set max $min
+    }
 
-    set tw [expr {$w - $padx - 2*($bd + $hl)}]
+    set tw [expr {$w - 2*($padx + $bd + $hl + 1)}]
+    set mw [expr {$max - 2*($padx + $bd + $hl + 1)}]
 
     set text [lindex $data(text,$name) 0]
     set textw [lindex $data(text,$name) 1]
 
     Button::configure $but -text $text -helptext ""
+    if {$textw <= $tw && $textw <= $mw} {
+	return
+    }
 
     set i -1
     foreach textw [lrange $data(text,$name) 2 end] {
-	if {$textw > $tw} {
+	if {$textw > $tw || $textw > $mw} {
 	    Button::configure $but -text [string range $text 0 $i]... \
 				   -helptext $text
 	    return

Modified: trunk/tkabber/ifacetk/iface.tcl
===================================================================
--- trunk/tkabber/ifacetk/iface.tcl	2007-04-18 18:48:01 UTC (rev 1119)
+++ trunk/tkabber/ifacetk/iface.tcl	2007-04-19 05:58:30 UTC (rev 1120)
@@ -1420,7 +1420,7 @@
     set page [nbpage $path]
     if {[.nb index $page] < 0} {
 	set page $path
-	set path [pack slaves [.nb getframe $page]]
+	set path [nbpath $page]
     }
 
     set st [wm state .]



More information about the Tkabber-dev mailing list