[Tkabber-dev] r738 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Sep 30 18:24:19 MSD 2006


Author: sergei
Date: 2006-09-30 18:24:09 +0400 (Sat, 30 Sep 2006)
New Revision: 738

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/balloon.tcl
   trunk/tkabber/chats.tcl
Log:
	* balloon.tcl: protected arguments of bind by double%.

	* chats.tcl: Use balloon::setup.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-09-30 13:20:00 UTC (rev 737)
+++ trunk/tkabber/ChangeLog	2006-09-30 14:24:09 UTC (rev 738)
@@ -11,8 +11,8 @@
 	* browser.tcl, disco.tcl, ifacetk/systray.tcl, messages.tcl,
 	  plugins/general/headlines.tcl, plugins/unix/dockingtray.tcl,
 	  plugins/unix/systray.tcl, plugins/unix/tktray.tcl,
-	  plugins/unix/wmdock.tcl, utils.tcl: Switched to balloon::setup
-	  when defining balloons.
+	  plugins/unix/wmdock.tcl, utils.tcl, chats.tcl: Switched to
+	  balloon::setup when defining balloons.
 
 2006-09-29  Sergei Golovan  <sgolovan at nes.ru>
 

Modified: trunk/tkabber/balloon.tcl
===================================================================
--- trunk/tkabber/balloon.tcl	2006-09-30 13:20:00 UTC (rev 737)
+++ trunk/tkabber/balloon.tcl	2006-09-30 14:24:09 UTC (rev 738)
@@ -53,7 +53,9 @@
 	}
     }
 
-    after idle [list .balloon.text configure -text $text -aspect $aspect -width $width]
+    after idle [list .balloon.text configure -text $text \
+					     -aspect $aspect \
+					     -width $width]
 }
 
 proc balloon::show {mx my} {
@@ -96,7 +98,8 @@
     
 
     wm deiconify .balloon
-# need the raise in case we're ballooning over a detached menu (emoticons)
+
+    # need the raise in case we're ballooning over a detached menu (emoticons)
     raise .balloon
 }
 
@@ -161,7 +164,7 @@
     set text ""
     set command ""
     set newargs $args
-    # $args may contain odd number of members, so a bit uncommon parsing
+    # $args may contain odd number of members, so a bit unusual parsing
     set idx 0
     foreach {opt val} $args {
 	switch -- $opt {
@@ -202,17 +205,21 @@
     # Try to bind in Tree widget
     if {![catch {
 	      $w bindText <Any-Enter> \
-		   [list eval [list [namespace current]::default_balloon $w enter %X %Y] $args]
+		   [list eval [list [namespace current]::default_balloon $w enter %X %Y] \
+				    [double% $args]]
 	 }]} {
 	$w bindText <Any-Motion> \
-	     [list eval [list [namespace current]::default_balloon $w motion %X %Y] $args]
+	     [list eval [list [namespace current]::default_balloon $w motion %X %Y] \
+			      [double% $args]]
 	$w bindText <Any-Leave> \
 	     [list balloon::default_balloon $w leave %X %Y]
     } else {
 	bind $w <Any-Enter> \
-	     [list eval [list [namespace current]::default_balloon $w enter %X %Y] $args]
+	     [list eval [list [namespace current]::default_balloon $w enter %X %Y] \
+			      [double% $args]]
 	bind $w <Any-Motion> \
-	     [list eval [list [namespace current]::default_balloon $w motion %X %Y] $args]
+	     [list eval [list [namespace current]::default_balloon $w motion %X %Y] \
+			      [double% $args]]
 	bind $w <Any-Leave> \
 	     [list balloon::default_balloon $w leave %X %Y]
     }

Modified: trunk/tkabber/chats.tcl
===================================================================
--- trunk/tkabber/chats.tcl	2006-09-30 13:20:00 UTC (rev 737)
+++ trunk/tkabber/chats.tcl	2006-09-30 14:24:09 UTC (rev 738)
@@ -496,16 +496,8 @@
 	bind $cw.status.subject <Escape> \
 	    [list chat::restore_subject [double% $chatid]]
 
-	bind $cw.status.subject <Any-Enter> \
-	    +[list eval balloon::set_text \
-		   \[[namespace current]::set_subject_balloon [list [double% $chatid]]\] \
-		   -width \[winfo width %W\]]
-
-	bind $cw.status.subject <Any-Motion> \
-	    [list eval balloon::on_mouse_move \
-		  \[[namespace current]::set_subject_balloon [list [double% $chatid]]\] %X %Y]
-
-	bind $cw.status.subject <Any-Leave> {+ balloon::destroy}
+	balloon::setup $cw.status.subject \
+		       -command [list [namespace current]::set_subject_balloon $chatid]
     }
     foreach tag [bind Menubutton] {
         if {[string first 1 $tag] >= 0} {
@@ -1272,10 +1264,14 @@
 
 proc chat::set_subject_balloon {chatid} {
     variable chats
+
+    set sw [winid $chatid].status.subject
+
     if {[info exists chats(subject_tooltip,$chatid)]} {
-	return $chats(subject_tooltip,$chatid)
+	return [list $chatid $chats(subject_tooltip,$chatid) \
+		     -width [winfo width $sw]]
     } else {
-	return ""
+	return [list $chatid ""]
     }
 }
 



More information about the Tkabber-dev mailing list