[Tkabber-dev] r1804 - in trunk/tkabber: . ifacetk plugins/chat plugins/filetransfer plugins/general plugins/pep plugins/richtext plugins/roster plugins/unix

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat May 9 20:00:44 MSD 2009


Author: sergei
Date: 2009-05-09 20:00:44 +0400 (Sat, 09 May 2009)
New Revision: 1804

Modified:
   trunk/tkabber/balloon.tcl
   trunk/tkabber/chats.tcl
   trunk/tkabber/custom.tcl
   trunk/tkabber/datagathering.tcl
   trunk/tkabber/disco.tcl
   trunk/tkabber/filetransfer.tcl
   trunk/tkabber/ifacetk/buttonbar.tcl
   trunk/tkabber/ifacetk/iface.tcl
   trunk/tkabber/ifacetk/ilogin.tcl
   trunk/tkabber/ifacetk/iroster.tcl
   trunk/tkabber/itemedit.tcl
   trunk/tkabber/messages.tcl
   trunk/tkabber/muc.tcl
   trunk/tkabber/plugins/chat/bookmark_highlighted.tcl
   trunk/tkabber/plugins/chat/draw_xhtml_message.tcl
   trunk/tkabber/plugins/chat/histool.tcl
   trunk/tkabber/plugins/chat/logger.tcl
   trunk/tkabber/plugins/chat/muc_ignore.tcl
   trunk/tkabber/plugins/chat/nick_colors.tcl
   trunk/tkabber/plugins/chat/popupmenu.tcl
   trunk/tkabber/plugins/chat/postpone.tcl
   trunk/tkabber/plugins/chat/unisymbols.tcl
   trunk/tkabber/plugins/filetransfer/http.tcl
   trunk/tkabber/plugins/filetransfer/si.tcl
   trunk/tkabber/plugins/general/headlines.tcl
   trunk/tkabber/plugins/general/ispell.tcl
   trunk/tkabber/plugins/general/message_archive.tcl
   trunk/tkabber/plugins/general/offline.tcl
   trunk/tkabber/plugins/general/rawxml.tcl
   trunk/tkabber/plugins/general/subscribe_gateway.tcl
   trunk/tkabber/plugins/general/xcommands.tcl
   trunk/tkabber/plugins/pep/user_tune.tcl
   trunk/tkabber/plugins/richtext/emoticons.tcl
   trunk/tkabber/plugins/richtext/urls.tcl
   trunk/tkabber/plugins/roster/annotations.tcl
   trunk/tkabber/plugins/unix/dockingtray.tcl
   trunk/tkabber/plugins/unix/systray.tcl
   trunk/tkabber/plugins/unix/tktray.tcl
   trunk/tkabber/privacy.tcl
   trunk/tkabber/pubsub.tcl
   trunk/tkabber/register.tcl
   trunk/tkabber/richtext.tcl
   trunk/tkabber/search.tcl
   trunk/tkabber/splash.tcl
   trunk/tkabber/userinfo.tcl
   trunk/tkabber/utils.tcl
Log:
	* balloon.tcl, chats.tcl, custom.tcl, datagathering.tcl, disco.tcl,
	  filetransfer.tcl, ifacetk/buttonbar.tcl, ifacetk/iface.tcl,
	  ifacetk/ilogin.tcl, ifacetk/iroster.tcl, itemedit.tcl, messages.tcl,
	  muc.tcl, plugins/chat/bookmark_highlighted.tcl,
	  plugins/chat/draw_xhtml_message.tcl, plugins/chat/histool.tcl,
	  plugins/chat/logger.tcl, plugins/chat/muc_ignore.tcl,
	  plugins/chat/nick_colors.tcl, plugins/chat/popupmenu.tcl,
	  plugins/chat/postpone.tcl, plugins/chat/unisymbols.tcl,
	  plugins/filetransfer/http.tcl, plugins/filetransfer/si.tcl,
	  plugins/general/headlines.tcl, plugins/general/ispell.tcl,
	  plugins/general/message_archive.tcl, plugins/general/offline.tcl,
	  plugins/general/rawxml.tcl, plugins/general/subscribe_gateway.tcl,
	  plugins/general/xcommands.tcl, plugins/pep/user_tune.tcl,
	  plugins/richtext/emoticons.tcl, plugins/richtext/urls.tcl,
	  plugins/roster/annotations.tcl, plugins/unix/dockingtray.tcl,
	  plugins/unix/systray.tcl, plugins/unix/tktray.tcl, privacy.tcl,
	  pubsub.tcl, register.tcl, richtext.tcl, search.tcl, splash.tcl,
	  userinfo.tcl, utils.tcl: Escaped % in event bindings.


Modified: trunk/tkabber/balloon.tcl
===================================================================
--- trunk/tkabber/balloon.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/balloon.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -206,23 +206,23 @@
     # Try to bind in Tree widget
     if {![catch {
 	      $w bindText <Any-Enter> \
-		   [list eval [list [namespace current]::default_balloon $w enter %X %Y] \
+		   [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] \
+	     [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]
+	     [list balloon::default_balloon %W leave %X %Y]
     } else {
 	bind $w <Any-Enter> \
-	     [list eval [list [namespace current]::default_balloon $w enter %X %Y] \
+	     [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] \
+	     [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]
+	     [list balloon::default_balloon %W leave %X %Y]
     }
 }
 

Modified: trunk/tkabber/chats.tcl
===================================================================
--- trunk/tkabber/chats.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/chats.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -560,8 +560,8 @@
 	chat::send_message [list $cw] [list $chatid] [list $type]
 	break"]
 
-    regsub -all %W [bind Text <Prior>] $cf.chat prior_binding
-    regsub -all %W [bind Text <Next>] $cf.chat next_binding
+    regsub -all %W [bind Text <Prior>] [double% $cf.chat] prior_binding
+    regsub -all %W [bind Text <Next>] [double% $cf.chat] next_binding
     bind $cw.input <Meta-Prior> $prior_binding
     bind $cw.input <Meta-Next> $next_binding
     bind $cw.input <Alt-Prior> $prior_binding

Modified: trunk/tkabber/custom.tcl
===================================================================
--- trunk/tkabber/custom.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/custom.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -223,10 +223,10 @@
     $t tag configure groupname -underline no \
 	-foreground [option get $w groupnameforeground Customize]
 
-    bind $t <Key-Down> [list $t yview scroll 1 unit]
-    bind $t <Key-Up> [list $t yview scroll -1 unit]
-    bind $t <Key-Next> [list $t yview scroll 1 page]
-    bind $t <Key-Prior> [list $t yview scroll -1 page]
+    bind $t <Key-Down> [list %W yview scroll 1 unit]
+    bind $t <Key-Up> [list %W yview scroll -1 unit]
+    bind $t <Key-Next> [list %W yview scroll 1 page]
+    bind $t <Key-Prior> [list %W yview scroll -1 page]
 
     variable history
     set history(pos) 0
@@ -432,7 +432,7 @@
 		$lb selection set $i
 	    }
 	    bind $lb <<ListboxSelect>> \
-		"set [namespace current]::tmp($varname) \[$lb curselection\]"
+		[double% "set [namespace current]::tmp($varname) \[$lb curselection\]"]
 	    $t window create end -window $fr -align top
 	    $t insert end "\n"
 	}

Modified: trunk/tkabber/datagathering.tcl
===================================================================
--- trunk/tkabber/datagathering.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/datagathering.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -130,7 +130,7 @@
 			lassign $tdata type data
 			if {![catch {image create photo -data $data} img]} {
 			    label $g.mediaimg$row -image $img
-			    bind $g.mediaimg$row <Destroy> [list image delete $img]
+			    bind $g.mediaimg$row <Destroy> [list image delete [double% $img]]
 			    grid $g.mediaimg$row -row $row -column 1 -sticky ew
 			    set unsupported 0
 			    incr row
@@ -418,9 +418,9 @@
 	-command [list eval $send_cmd [list $w] \[data::get_tags $f\]]
     $bbox add -text [::msgcat::mc "Cancel"] \
 	-command [list eval $cancel_cmd [list $w]]
-    bind $w <Return> [list ButtonBox::invoke $bbox default]
-    bind $w <Escape> [list ButtonBox::invoke $bbox 1]
-    bind $f <Destroy> [list [namespace current]::cleanup $f]
+    bind $w <Return> [list ButtonBox::invoke [double% $bbox] default]
+    bind $w <Escape> [list ButtonBox::invoke [double% $bbox] 1]
+    bind $f <Destroy> [list [namespace current]::cleanup %W]
 
     bindscroll $f $sf
 

Modified: trunk/tkabber/disco.tcl
===================================================================
--- trunk/tkabber/disco.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/disco.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -328,7 +328,7 @@
     set config(identitycolor) [option get $w identitycolor JDisco]
     set config(optioncolor)   [option get $w optioncolor   JDisco]
 
-    bind $w <Destroy> [list [namespace current]::destroy_state $w]
+    bind $w <Destroy> [list [namespace current]::destroy_state %W [double% $w]]
 
     frame $w.navigate
     button $w.navigate.back -text <- \
@@ -347,8 +347,8 @@
     button $w.navigate.browse -text [::msgcat::mc "Browse"] \
 	-command [list [namespace current]::go $w]
 
-    bind $w.navigate.entry <Return> [list [namespace current]::go $w]
-    bind $w.navigate.node <Return> [list [namespace current]::go $w]
+    bind $w.navigate.entry <Return> [list [namespace current]::go [double% $w]]
+    bind $w.navigate.node <Return> [list [namespace current]::go [double% $w]]
 
     pack $w.navigate.back $w.navigate.forward $w.navigate.lentry -side left
     pack $w.navigate.browse -side right
@@ -373,8 +373,8 @@
     bindscroll $tw.c
 
     # HACK
-    bind $tw.c <Return> [list [namespace current]::activate_node $w $tw]
-    bind $tw.c <Delete> [list [namespace current]::delete_node $w $tw]
+    bind $tw.c <Return> [list [namespace current]::activate_node [double% $w] [double% $tw]]
+    bind $tw.c <Delete> [list [namespace current]::delete_node [double% $w] [double% $tw]]
 
     lappend browser(opened) $w
     set browser(opened) [lrmdups $browser(opened)]
@@ -1180,9 +1180,11 @@
 
 # Destroy all (global) state assotiated with the given browser window.
 # Intended to be bound to a <Destroy> event handler for browser windows.
-proc disco::browser::destroy_state {bw} {
+proc disco::browser::destroy_state {bw bw1} {
     variable browser
 
+    if {$bw != $bw1} return
+
     array unset browser *,$bw
     array unset browser *,$bw,*
 

Modified: trunk/tkabber/filetransfer.tcl
===================================================================
--- trunk/tkabber/filetransfer.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/filetransfer.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -175,7 +175,7 @@
 	   -command [list [namespace current]::send_file_negotiate $token]
     $w add -text [::msgcat::mc "Cancel"] -command [list destroy $w]
 
-    bind $w <Destroy> [list [namespace current]::send_file_close $token %W]
+    bind $w <Destroy> [list [namespace current]::send_file_close [double% $token] %W]
 
     set f [$w getframe]
     set state(f) $f

Modified: trunk/tkabber/ifacetk/buttonbar.tcl
===================================================================
--- trunk/tkabber/ifacetk/buttonbar.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/ifacetk/buttonbar.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -51,7 +51,7 @@
 
     frame $path.spacer -width [winfo screenwidth $path]
 
-    bind $path <Configure> [list [namespace current]::_configure $path]
+    bind $path <Configure> [list [namespace current]::_configure %W]
 
     set data(buttons)  [list]
     set data(active) ""
@@ -125,10 +125,11 @@
 
     _calc_text $path $name
 
-    bind $but <Configure> [list [namespace current]::_itemconfigure $path $name]
+    bind $but <Configure> [list [namespace current]::_itemconfigure \
+				[_escape $path] [_escape $name]]
 
     foreach {event script} $data(bindtabs) {
-	bind $but $event [linsert $script end $name]
+	bind $but $event [linsert $script end [_escape $name]]
     }
 
     DragSite::register $but \
@@ -502,7 +503,7 @@
     lappend data(bindtabs) $event $script
 
     foreach name $data(buttons) {
-	bind [_but $path $name] $event [linsert $script end $name]
+	bind [_but $path $name] $event [linsert $script end [_escape $name]]
     }
 }
 
@@ -601,4 +602,9 @@
     }
 }
 
-
+# ----------------------------------------------------------------------------
+#  Command ButtonBar::_escape
+# ----------------------------------------------------------------------------
+proc ButtonBar::_escape {str} {
+    string map {% %%} $str
+}

Modified: trunk/tkabber/ifacetk/iface.tcl
===================================================================
--- trunk/tkabber/ifacetk/iface.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/ifacetk/iface.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -815,10 +815,10 @@
 
     set w .presence.status
     ComboBox $w -textvariable textstatus -values $status_history
-    $w bind <Return> {set userstatus $userstatus}
+    $w bind <Return> {set userstatus [double% $userstatus]}
     trace variable ::userstatus w \
 	[list [namespace current]::save_availability_status $w]
-    $w bind <Button-3> [list [namespace current]::show_status_context_menu $w]
+    $w bind <Button-3> [list [namespace current]::show_status_context_menu %W]
     if {$usetabbar} {
 	pack .presence.button -side left
 	pack .presence.status -side left -fill x -expand yes

Modified: trunk/tkabber/ifacetk/ilogin.tcl
===================================================================
--- trunk/tkabber/ifacetk/ilogin.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/ifacetk/ilogin.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -122,7 +122,7 @@
 		$m add command -label $lab -accelerator "$::tk_modify-$j" \
 		    -command [list [namespace current]::update_login_entries $l $i]
 		bind .login <Control-Key-$j> \
-		    [list [namespace current]::update_login_entries $l $i]
+		    [list [namespace current]::update_login_entries [double% $l] $i]
 	    } else {
 		$m add command -label $lab \
 		    -command [list [namespace current]::update_login_entries $l $i]
@@ -347,8 +347,8 @@
 
     $nb compute_size
     $nb raise account_page
-    bind .login <Control-Prior> [list [namespace current]::tab_move $nb -1]
-    bind .login <Control-Next> [list [namespace current]::tab_move $nb 1]
+    bind .login <Control-Prior> [list [namespace current]::tab_move [double% $nb] -1]
+    bind .login <Control-Next> [list [namespace current]::tab_move [double% $nb] 1]
     grid $nb -row 1 -column 0
 
     .login add -text [::msgcat::mc "Log in"] -command {

Modified: trunk/tkabber/ifacetk/iroster.tcl
===================================================================
--- trunk/tkabber/ifacetk/iroster.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/ifacetk/iroster.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -1277,9 +1277,9 @@
 			       [expr {$x + [font measure $::RosterFont $text]}]]
 
     $c bind jid$tag&&$type <Any-Enter> \
-	    [list $c itemconfig jid$tag&&$type&&rect -fill $hlfill]
+	    [double% [list $c itemconfig jid$tag&&$type&&rect -fill $hlfill]]
     $c bind jid$tag&&$type <Any-Leave> \
-	    [list $c itemconfig jid$tag&&$type&&rect -fill $rfill]
+	    [double% [list $c itemconfig jid$tag&&$type&&rect -fill $rfill]]
 
     set doubledjid  [double% $jid]
     set doubledjids [double% $jids]
@@ -1293,7 +1293,7 @@
 	    $c bind jid$tag&&$type <Button-1> \
 		    [list [namespace current]::on_singleclick \
 			  [double% $iroster($w,singleclick)] \
-			  $c %x %y $doubledjid $doubledjids]
+			  [double% $c] %x %y $doubledjid $doubledjids]
 
 	    $c bind jid$tag&&$type <Double-Button-1> \
 		    [list [namespace current]::on_doubleclick \
@@ -1324,7 +1324,7 @@
 
 	    if {![string equal $iroster($w,grouppopup) {}]} {
 		$c bind jid$tag&&group <3> \
-		        [list $iroster($w,grouppopup) $doubledjid]
+		        [list [double% $iroster($w,grouppopup)] $doubledjid]
 	    }
 	}
     }

Modified: trunk/tkabber/itemedit.tcl
===================================================================
--- trunk/tkabber/itemedit.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/itemedit.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -76,7 +76,7 @@
 
 
     bindtags $gal [list Listbox $gal . all]
-    bind $gal <1> [list itemedit::select_available_group $gal $gae]
+    bind $gal <1> [list itemedit::select_available_group %W [double% $gae]]
 
     $w draw
 }

Modified: trunk/tkabber/messages.tcl
===================================================================
--- trunk/tkabber/messages.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/messages.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -63,14 +63,14 @@
 	    -command "chat::open_to_user [list $xlib] [list $from]
                       destroy $mw"
         $bbox add -text [::msgcat::mc "Close"] -command [list destroy $mw]
-        bind $mw <Control-Return> "ButtonBox::invoke $bbox 0"
-        bind $mw <Escape> "ButtonBox::invoke $bbox 2"
+        bind $mw <Control-Return> "ButtonBox::invoke [double% $bbox] 0"
+        bind $mw <Escape> "ButtonBox::invoke [double% $bbox] 2"
         pack $bbox -side right -fill x -padx 2m -pady 2m
     } else {
         ButtonBox $mw.bottom.buttons -spacing 0 -padx 10
         $mw.bottom.buttons add -text [::msgcat::mc "Close"] -command [list destroy $mw]
-        bind $mw <Return> "ButtonBox::invoke $mw.bottom.buttons 0"
-        bind $mw <Escape> "ButtonBox::invoke $mw.bottom.buttons 0"
+        bind $mw <Return> "ButtonBox::invoke [double% $mw.bottom.buttons] 0"
+        bind $mw <Escape> "ButtonBox::invoke [double% $mw.bottom.buttons] 0"
     }
     pack $mw.bottom.buttons -side right -fill x -padx 2m -pady 2m
 
@@ -197,7 +197,7 @@
 
         textUndoable $mw.body -width 60 -height 8 -wrap word
         pack $mw.body -side top -fill both -expand yes -in $mw.sw
-        bind $mw.body <Control-Return> "ButtonBox::invoke $bbox 0
+        bind $mw.body <Control-Return> "ButtonBox::invoke [double% $bbox] 0
                 break"
         $mw.sw setwidget $mw.body
 
@@ -366,8 +366,8 @@
     $bbox add -text [::msgcat::mc "Send"] \
 	-command [list message::send $mw $xlib -group $group]
     $bbox add -text [::msgcat::mc "Cancel"] -command [list destroy $mw]
-    bind $mw <Control-Return> "ButtonBox::invoke $bbox 0"
-    bind $mw <Escape> "ButtonBox::invoke $bbox 1"
+    bind $mw <Control-Return> "ButtonBox::invoke [double% $bbox] 0"
+    bind $mw <Escape> "ButtonBox::invoke [double% $bbox] 1"
     pack $bbox -side right -fill x -padx 2m -pady 2m
 
     set sep [Separator::create $mw.sep -orient horizontal]
@@ -431,7 +431,7 @@
 
     textUndoable $mw.body -width 60 -height 8 -wrap word
     pack $mw.body -side top -fill both -expand yes -in $mw.sw
-    bind $mw.body <Control-Return> "ButtonBox::invoke $bbox 0
+    bind $mw.body <Control-Return> "ButtonBox::invoke [double% $bbox] 0
             break"
     $mw.sw setwidget $mw.body
 
@@ -590,8 +590,8 @@
 	      -command [list [namespace current]::subscribe $mw $xlib $from]
     $bbox add -text [::msgcat::mc "Decline subscription"] \
 	      -command [list [namespace current]::unsubscribe $mw $xlib $from]
-    bind $mw <Return> "ButtonBox::invoke $bbox default"
-    bind $mw <Escape> "ButtonBox::invoke $bbox 1"
+    bind $mw <Return> "ButtonBox::invoke [double% $bbox] default"
+    bind $mw <Escape> "ButtonBox::invoke [double% $bbox] 1"
     pack $bbox -side bottom -anchor e -padx 2m -pady 2m
 
     set sep [Separator::create $mw.sep -orient horizontal]
@@ -825,8 +825,8 @@
     $bbox add -text [::msgcat::mc "Request subscription"] \
         -command [list message::send_subscribe0 $mw]
     $bbox add -text [::msgcat::mc "Cancel"] -command [list destroy $mw]
-    bind $mw <Return> "ButtonBox::invoke $bbox default"
-    bind $mw <Escape> "ButtonBox::invoke $bbox 1"
+    bind $mw <Return> "ButtonBox::invoke [double% $bbox] default"
+    bind $mw <Escape> "ButtonBox::invoke [double% $bbox] 1"
     pack $bbox -side bottom -anchor e -padx 2m -pady 2m
 
     set sep [Separator::create $mw.sep -orient horizontal]

Modified: trunk/tkabber/muc.tcl
===================================================================
--- trunk/tkabber/muc.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/muc.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -583,8 +583,9 @@
     $w add -text [::msgcat::mc "Send"] \
 	-command [list muc::send_list $chatid $attr $val $w $f]
     $w add -text [::msgcat::mc "Cancel"] -command [list destroy $w]
-    bind $w <Destroy> [list after idle [list muc::list_cleanup $w $f]]
 
+    bind $f <Destroy> [list muc::list_cleanup %W]
+
     frame $w.fr
     pack $w.fr -side bottom -in $wf -fill x
 
@@ -895,7 +896,7 @@
 
 ###############################################################################
 
-proc muc::list_cleanup {w f} {
+proc muc::list_cleanup {f} {
     variable listdata
     variable origlistdata
 

Modified: trunk/tkabber/plugins/chat/bookmark_highlighted.tcl
===================================================================
--- trunk/tkabber/plugins/chat/bookmark_highlighted.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/chat/bookmark_highlighted.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -23,8 +23,8 @@
     if {!$usetabbar} {
 	set cw [chat::chat_win $chatid]
 	set top [winfo toplevel $cw]
-	bind $top <Shift-F3> [list [namespace current]::next_bookmark $cw]
-	bind $top <F3>       [list [namespace current]::prev_bookmark $cw]
+	bind $top <Shift-F3> [list [namespace current]::next_bookmark [double% $cw]]
+	bind $top <F3>       [list [namespace current]::prev_bookmark [double% $cw]]
     }
 }
 

Modified: trunk/tkabber/plugins/chat/draw_xhtml_message.tcl
===================================================================
--- trunk/tkabber/plugins/chat/draw_xhtml_message.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/chat/draw_xhtml_message.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -388,9 +388,9 @@
     $chatw tag configure $tag -foreground $urlfg -underline 1
     $chatw tag bind $tag <1> [list browseurl [double% $url]]
     $chatw tag bind $tag <Any-Enter> \
-	[list ::richtext::highlighttext $chatw $tag $urlactfg hand2]
+	[list ::richtext::highlighttext %W [double% $tag] [double% $urlactfg] hand2]
     $chatw tag bind $tag <Any-Leave> \
-	[list ::richtext::highlighttext $chatw $tag $urlfg xterm]
+	[list ::richtext::highlighttext %W [double% $tag] [double% $urlfg] xterm]
     $chatw tag raise $tag
     return $tag
 }

Modified: trunk/tkabber/plugins/chat/histool.tcl
===================================================================
--- trunk/tkabber/plugins/chat/histool.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/chat/histool.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -52,10 +52,10 @@
 	    -class ChatHistory \
 	    -raise 1
 
-    bind $w <Destroy> +[list [namespace current]::browser_cleanup [double% $w] %W]
-
     set nb [NoteBook $w.nb]
 
+    bind $nb <Destroy> +[list [namespace current]::browser_cleanup]
+
     set p [$nb insert end jidlist \
 	       -text [::msgcat::mc "JID list"] \
 	       -raisecmd [list [namespace current]::jidlist_raise $nb]]
@@ -76,9 +76,7 @@
     $nb raise jidlist
 }
 
-proc histool::browser_cleanup {w1 w2} {
-    if {![string equal $w1 $w2]} return
-
+proc histool::browser_cleanup {} {
     variable loghier
     unset loghier
 }
@@ -124,7 +122,7 @@
 	    -closecommand  [list [namespace current]::jidlist_spanel_close $lbox]]
 
     bind $lbox <<OpenSearchPanel>> \
-	 [list [namespace current]::jidlist_spanel_open $w $sp]
+	 [double% [list [namespace current]::jidlist_spanel_open $w $sp]]
 }
 
 proc histool::jidlist_open_log {w idx args} {
@@ -283,7 +281,7 @@
     set ftsearch(results) $r
     set ftsearch(bg) EVEN
 
-    bind $w <Destroy> +[list [namespace current]::ftsearch_cleanup [double% $w] %W]
+    bind $w <Destroy> +[list [namespace current]::ftsearch_cleanup]
 
     # Set search panel up:
 
@@ -578,9 +576,7 @@
 # is destroyed. "ftsearch_terminate" variable is
 # unset in the [after ...] event handler, if such
 # handler is installed.
-proc histool::ftsearch_cleanup {w1 w2} {
-    if {![string equal $w1 $w2]} return
-
+proc histool::ftsearch_cleanup {} {
     variable ftsearch
     array unset ftsearch
 

Modified: trunk/tkabber/plugins/chat/logger.tcl
===================================================================
--- trunk/tkabber/plugins/chat/logger.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/chat/logger.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -293,10 +293,10 @@
 
     $lf setwidget $l
 
-    regsub -all %W [bind Text <Prior>] $l prior_binding
-    regsub -all %W [bind Text <Next>] $l next_binding
+    regsub -all %W [bind Text <Prior>] [double% $l] prior_binding
+    regsub -all %W [bind Text <Next>]  [double% $l] next_binding
     bind $lw <Prior> $prior_binding
-    bind $lw <Next> $next_binding
+    bind $lw <Next>  $next_binding
 
     $l tag configure they -foreground [option get $lw theyforeground Chat]
     $l tag configure me -foreground [option get $lw meforeground Chat]

Modified: trunk/tkabber/plugins/chat/muc_ignore.tcl
===================================================================
--- trunk/tkabber/plugins/chat/muc_ignore.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/chat/muc_ignore.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -563,27 +563,25 @@
 	-raise 1
 	#-raisecmd "focus [list $w.input]"
 
-    bind $w <Destroy> [list [namespace current]::cleanup $w %W]
-
     set sw [ScrolledWindow $w.sw -auto both]
     set t [Tree $w.tree -background [$w cget -background]]
     $sw setwidget $t
 
+    bind $sw <Destroy> [list [namespace current]::cleanup [double% $w]]
+
     pack $sw -fill both -expand true
 
     # NOTE that BWidget Tree doesn't aceept keyboard bindings.
 
-    $t bindText <Double-ButtonPress-1> [list $t toggle]
-    bind $w <KeyPress-Return> [list [namespace current]::tree_toggle $t]
+    $t bindText <Double-ButtonPress-1> [list %W toggle]
+    bind $w <KeyPress-Return> [list [namespace current]::tree_toggle [double% $t]]
 
-    bind $w <KeyPress-F2> [list [namespace current]::tree_edit_item $t]
-    bind $w <Any-KeyPress-Insert> [list [namespace current]::tree_insert_item $t]
-    bind $w <Any-KeyPress-Delete> [list [namespace current]::tree_insert_item $t]
+    bind $w <KeyPress-F2> [list [namespace current]::tree_edit_item [double% $t]]
+    bind $w <Any-KeyPress-Insert> [list [namespace current]::tree_insert_item [double% $t]]
+    bind $w <Any-KeyPress-Delete> [list [namespace current]::tree_insert_item [double% $t]]
 }
 
-proc mucignore::editor::cleanup {w1 w2} {
-    if {$w1 != $w2} return
-
+proc mucignore::editor::cleanup {w} {
     # TODO do appropriate cleanup...
 }
 

Modified: trunk/tkabber/plugins/chat/nick_colors.tcl
===================================================================
--- trunk/tkabber/plugins/chat/nick_colors.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/chat/nick_colors.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -181,10 +181,10 @@
     $w add -text [::msgcat::mc "Cancel"] \
 	-command [list [namespace current]::end_dialog $w cancel]
 
-    bind $w <Destroy> [list [namespace current]::end_dialog $w cancel]
-
     set f [$w getframe]
 
+    bind $f <Destroy> [list [namespace current]::end_dialog [double% $w] cancel]
+
     set tools [frame $f.tools]
     pack $tools -side bottom -fill x
     
@@ -198,11 +198,11 @@
 	set clr $NickColors($nick)
         $lf tag configure NICK-$nick -foreground $clr
         $lf tag bind NICK-$nick <Enter> \
-            [list [namespace current]::on_nick_hover $lf $nick Enter]
+            [double% [list [namespace current]::on_nick_hover $lf $nick Enter]]
         $lf tag bind NICK-$nick <Leave> \
-            [list [namespace current]::on_nick_hover $lf $nick Leave]
+            [double% [list [namespace current]::on_nick_hover $lf $nick Leave]]
         $lf tag bind NICK-$nick <ButtonPress-1> \
-            [list [namespace current]::on_nick_click $lf $nick]
+            [double% [list [namespace current]::on_nick_click $lf $nick]]
         $lf insert end $nick [list NICK-$nick]
 	$lf insert end "\n"
     }
@@ -217,7 +217,7 @@
     variable NickColors
     variable NickColorEdits
 
-    bind $w <Destroy> { }
+    bind [$w getframe] <Destroy> { }
     destroy $w
 
     if {$res == "ok"} {

Modified: trunk/tkabber/plugins/chat/popupmenu.tcl
===================================================================
--- trunk/tkabber/plugins/chat/popupmenu.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/chat/popupmenu.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -27,10 +27,10 @@
 
     if {!$usetabbar} {
 	set top [winfo toplevel $cw]
-	bind $top <Shift-F2>  [list [namespace current]::BookmarkNext $cw]
-	bind $top <F2>        [list [namespace current]::BookmarkPrev $cw]
-	bind $top <Control-G> [list [namespace current]::GoogleSelection $cw]
-	bind $top <Control-g> [list [namespace current]::GoogleSelection $cw]
+	bind $top <Shift-F2>  [list [namespace current]::BookmarkNext [double% $cw]]
+	bind $top <F2>        [list [namespace current]::BookmarkPrev [double% $cw]]
+	bind $top <Control-G> [list [namespace current]::GoogleSelection [double% $cw]]
+	bind $top <Control-g> [list [namespace current]::GoogleSelection [double% $cw]]
     }
 }
 

Modified: trunk/tkabber/plugins/chat/postpone.tcl
===================================================================
--- trunk/tkabber/plugins/chat/postpone.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/chat/postpone.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -30,19 +30,17 @@
 
     set state($w,buffer) [list]
 
-    bind $w <Destroy> +[list [namespace current]::cleanup_text_widget $w %W]
-    bind $w <<ChatPushText>> [list [namespace current]::buffer_push $w]
+    bind $w <Destroy> +[list [namespace current]::cleanup_text_widget %W]
+    bind $w <<ChatPushText>> [list [namespace current]::buffer_push %W]
     bind $w <<ChatPushText>> +break
-    bind $w <<ChatPopText>> [list [namespace current]::buffer_pop $w]
+    bind $w <<ChatPopText>> [list [namespace current]::buffer_pop %W]
     bind $w <<ChatPopText>> +break
 }
 
-proc postpone::cleanup_text_widget {w1 w2} {
+proc postpone::cleanup_text_widget {w} {
     variable state
 
-    if {$w1 != $w2} return
-
-    array unset state $w1,*
+    array unset state $w,*
 }
 
 proc postpone::buffer_push {w} {

Modified: trunk/tkabber/plugins/chat/unisymbols.tcl
===================================================================
--- trunk/tkabber/plugins/chat/unisymbols.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/chat/unisymbols.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -15,7 +15,7 @@
 proc unisymbols::setup_bindings {chatid type} {
     set iw [chat::input_win $chatid]
     bind $iw <Control-Key-semicolon> \
-	[list [namespace current]::expand_entity $iw]
+	[list [namespace current]::expand_entity %W]
 }
 hook::add open_chat_post_hook [namespace current]::unisymbols::setup_bindings
 

Modified: trunk/tkabber/plugins/filetransfer/http.tcl
===================================================================
--- trunk/tkabber/plugins/filetransfer/http.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/filetransfer/http.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -221,7 +221,7 @@
     $w add -text [::msgcat::mc "Cancel"] \
 	-command [list destroy $w]
     bind .ftrfd$winid <Destroy> \
-	[list [namespace current]::recv_file_cancel $winid $lang]
+	 [double% [list [namespace current]::recv_file_cancel $winid $lang]]
 
     $w draw
     vwait [namespace current]::result($winid)
@@ -285,7 +285,7 @@
 			 -cancel 0]
     } else {
 	bind .ftrfd$winid <Destroy> \
-	    [list [namespace current]::recv_file_cancel $winid $lang $token]
+	     [double% [list [namespace current]::recv_file_cancel $winid $lang $token]]
     }
 }
 

Modified: trunk/tkabber/plugins/filetransfer/si.tcl
===================================================================
--- trunk/tkabber/plugins/filetransfer/si.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/filetransfer/si.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -180,7 +180,8 @@
     $w add -text [::msgcat::mc "Cancel"] -command \
 	[namespace code [list recv_file_cancel $token $w $command]]
     
-    bind $w <Destroy> [namespace code [list recv_file_cancel $token $w $command]]
+    bind $w <Destroy> \
+	 [double% [namespace code [list recv_file_cancel $token $w $command]]]
 
     $w draw
     return
@@ -229,7 +230,7 @@
 
     $state(w) itemconfigure 0 -state disabled
     $state(w) itemconfigure 1 -command [namespace code [list recv_file_close $token $w %W]]
-    bind $w <Destroy> [namespace code [list recv_file_close $token $w %W]]
+    bind $w <Destroy> [namespace code [list recv_file_close [double% $token] [double% $w] %W]]
 
     if {[catch {si::newin $state(xlib) $state(jid) $state(id)} stream]} {
 	# Return error to the sender but leave transfer window with disabled

Modified: trunk/tkabber/plugins/general/headlines.tcl
===================================================================
--- trunk/tkabber/plugins/general/headlines.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/general/headlines.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -186,9 +186,9 @@
 
     # HACK
     bind $tw.c <Return> \
-	 "[namespace current]::action browse $hw \[$tw selection get\]"
+	 [double% "[namespace current]::action browse $hw \[$tw selection get\]"]
     bind $tw.c <Delete> \
-	 "[namespace current]::action delete $hw \[$tw selection get\]"
+	 [double% "[namespace current]::action delete $hw \[$tw selection get\]"]
 
     bindscroll $tw.c
 
@@ -202,10 +202,10 @@
     bind $hw.body <ButtonPress-1> [list focus %W]
 
     foreach ww [list $hw.body $dw.date.ts $dw.from.jid $dw.subject.subj] {
-	bind $ww <Key-Up>    [list Tree::_keynav up    $tw]
-	bind $ww <Key-Down>  [list Tree::_keynav down  $tw]
-	bind $ww <Key-Left>  [list Tree::_keynav left  $tw]
-	bind $ww <Key-Right> [list Tree::_keynav right $tw]
+	bind $ww <Key-Up>    [list Tree::_keynav up    [double% $tw]]
+	bind $ww <Key-Down>  [list Tree::_keynav down  [double% $tw]]
+	bind $ww <Key-Left>  [list Tree::_keynav left  [double% $tw]]
+	bind $ww <Key-Right> [list Tree::_keynav right [double% $tw]]
     }
 
     hook::run open_headlines_post_hook $hw $tw $uw $dw

Modified: trunk/tkabber/plugins/general/ispell.tcl
===================================================================
--- trunk/tkabber/plugins/general/ispell.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/general/ispell.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -347,9 +347,9 @@
 
 proc ispell::setup_bindings {iw} {
     clear_ispell $iw
-    bind $iw <KeyPress> [list [namespace current]::key_process $iw %N]
-    bind $iw <Return> +[list [namespace current]::clear_ispell $iw]
-    bind $iw <3> [list [namespace current]::popup_menu $iw %x %y]
+    bind $iw <KeyPress> [list [namespace current]::key_process %W %N]
+    bind $iw <Return> +[list [namespace current]::clear_ispell %W]
+    bind $iw <3> [list [namespace current]::popup_menu %W %x %y]
     $iw tag configure err -foreground [option get $iw errorColor Text]
     $iw tag configure combo -foreground [option get $iw comboColor Text]
 }

Modified: trunk/tkabber/plugins/general/message_archive.tcl
===================================================================
--- trunk/tkabber/plugins/general/message_archive.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/general/message_archive.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -101,13 +101,15 @@
 
 
     set lastsort($l) ""
-    bind $l <Destroy> +[list [namespace current]::delete_lastsort $l]
+    bind $l <Destroy> +[list [namespace current]::delete_lastsort %W]
 
     bind $l <1> \
-	    "[namespace current]::select_and_print_body $dw $l \[$l nearest \[::mclistbox::convert %W -y %y\]\]"
+	    "[namespace current]::select_and_print_body \
+	     [double% $dw] %W \[%W nearest \[::mclistbox::convert %W -y %y\]\]"
 
 #    bind $l <3> \
-#	    "[namespace current]::select_and_popup_menu $l \[$l nearest \[::mclistbox::convert %W -y %y\]\]"
+#	    "[namespace current]::select_and_popup_menu \
+#	     %W \[%W nearest \[::mclistbox::convert %W -y %y\]\]"
 
     bindscroll $sww $l
 
@@ -121,7 +123,7 @@
     array unset messages
 
     foreach var {timestamp fromto subject} {
-	$l label bind $var <ButtonPress-1> "[namespace current]::sort %W $var"
+	$l label bind $var <ButtonPress-1> "[namespace current]::sort %W [double% $var]"
     }
 
     $l column add lastcol -label "" -width 0

Modified: trunk/tkabber/plugins/general/offline.tcl
===================================================================
--- trunk/tkabber/plugins/general/offline.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/general/offline.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -70,7 +70,7 @@
 
     # HACK
     bind $tw.c <Return> \
-         "[namespace current]::message_action fetch $tw \[$tw selection get\]"
+         [double% "[namespace current]::message_action fetch $tw \[$tw selection get\]"]
     bindscroll $tw.c
 }
 

Modified: trunk/tkabber/plugins/general/rawxml.tcl
===================================================================
--- trunk/tkabber/plugins/general/rawxml.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/general/rawxml.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -267,8 +267,8 @@
     set history(stack) [list {}]
     set history(pos) 0
 
-    regsub -all %W [bind Text <Prior>] $dump prior_binding
-    regsub -all %W [bind Text <Next>] $dump next_binding
+    regsub -all %W [bind Text <Prior>] [double% $dump] prior_binding
+    regsub -all %W [bind Text <Next>]  [double% $dump] next_binding
     bind $input <Meta-Prior> $prior_binding
     bind $input <Meta-Next> $next_binding
     bind $input <Alt-Prior> $prior_binding

Modified: trunk/tkabber/plugins/general/subscribe_gateway.tcl
===================================================================
--- trunk/tkabber/plugins/general/subscribe_gateway.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/general/subscribe_gateway.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -30,8 +30,8 @@
         -command [list [namespace current]::send_subscribe $mw $xlib $service]
     $bbox add -text [::msgcat::mc "Cancel"] -command [list destroy $mw]
 
-    bind $mw <Return> "ButtonBox::invoke $bbox default"
-    bind $mw <Escape> "ButtonBox::invoke $bbox 1"
+    bind $mw <Return> "ButtonBox::invoke [double% $bbox] default"
+    bind $mw <Escape> "ButtonBox::invoke [double% $bbox] 1"
 
     pack $bbox -side bottom -anchor e -padx 2m -pady 2m
 
@@ -45,7 +45,7 @@
     pack $mw.prompt -side top -anchor w -in $mw.frame
 
     variable $mw.prompt fulljid
-    bind $mw <Destroy> [list catch [list unset [namespace current]::$mw.prompt]]
+    bind $mw <Destroy> [list catch [list unset [namespace current]::%W.prompt]]
 
     ::xmpp::sendIQ $xlib get \
         -query [::xmpp::xml::create query \

Modified: trunk/tkabber/plugins/general/xcommands.tcl
===================================================================
--- trunk/tkabber/plugins/general/xcommands.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/general/xcommands.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -152,8 +152,8 @@
     }
     # Can't configure -cancel option because of bug in BWidget
     # $w configure -cancel $cancel
-    bind $w <Escape> "$w invoke $cancel"
-    bind $f <Destroy> [list data::cleanup $f]
+    bind $w <Escape> [list %W invoke $cancel]
+    bind $f <Destroy> [list data::cleanup %W]
 
     bindscroll $f $sf
 

Modified: trunk/tkabber/plugins/pep/user_tune.tcl
===================================================================
--- trunk/tkabber/plugins/pep/user_tune.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/pep/user_tune.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -491,7 +491,7 @@
 
     grid columnconfigure $f 1 -weight 1
 
-    bind $w <Destroy> [list [namespace current]::cleanup_publish_dialog $w %W]
+    bind $f <Destroy> [list [namespace current]::cleanup_publish_dialog]
     $w draw
 }
 
@@ -556,9 +556,7 @@
     destroy $w
 }
 
-proc tune::cleanup_publish_dialog {w1 w2} {
-    if {![string equal $w1 $w2]} return
-
+proc tune::cleanup_publish_dialog {} {
     variable tuneartist
     variable tunetitle
     variable tunetrack

Modified: trunk/tkabber/plugins/richtext/emoticons.tcl
===================================================================
--- trunk/tkabber/plugins/richtext/emoticons.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/richtext/emoticons.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -330,11 +330,11 @@
     }
 
     bind $m <Any-Enter>  \
-	[list [namespace current]::balloon $m enter  %X %Y %x %y]
+	[list [namespace current]::balloon %W enter  %X %Y %x %y]
     bind $m <Any-Motion> \
-	[list [namespace current]::balloon $m motion %X %Y %x %y]
+	[list [namespace current]::balloon %W motion %X %Y %x %y]
     bind $m <Any-Leave>  \
-	[list [namespace current]::balloon $m leave  %X %Y %x %y]
+	[list [namespace current]::balloon %W leave  %X %Y %x %y]
 
     tk_popup $m [winfo pointerx .] [winfo pointery .]
 }
@@ -403,7 +403,7 @@
     set iw [chat::input_win $chatid]
 
     bind $iw <<EmoticonsMenu>> \
-	[list [namespace current]::show_menu $iw]
+	[list [namespace current]::show_menu %W]
     bind $iw <<EmoticonsMenu>> +break
 }
 

Modified: trunk/tkabber/plugins/richtext/urls.tcl
===================================================================
--- trunk/tkabber/plugins/richtext/urls.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/richtext/urls.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -176,19 +176,19 @@
     $w tag add $type $url_start {end - 1 char}
 
     $w tag bind $privtag <Any-Enter> \
-	[list ::richtext::highlighttext \
-	      $w $privtag $options(activeforeground) $options(cursor)]
+	[double% [list ::richtext::highlighttext \
+		       $w $privtag $options(activeforeground) $options(cursor)]]
     $w tag bind $privtag <Any-Leave> \
-	[list ::richtext::highlighttext \
-	      $w $privtag $options(foreground) [lindex [$w configure -cursor] 3]]
+	[double% [list ::richtext::highlighttext \
+		       $w $privtag $options(foreground) [lindex [$w configure -cursor] 3]]]
 
     if {$show_hints} {
 	$w tag bind $privtag <Any-Enter> \
-	    +[list [namespace current]::balloon $w $privtag enter %x %y %X %Y]
+	    +[list [namespace current]::balloon [double% $w] [double% $privtag] enter %x %y %X %Y]
 	$w tag bind $privtag <Any-Motion> \
-	    +[list [namespace current]::balloon $w $privtag motion %x %y %X %Y]
+	    +[list [namespace current]::balloon [double% $w] [double% $privtag] motion %x %y %X %Y]
 	$w tag bind $privtag <Any-Leave> \
-	    +[list [namespace current]::balloon $w $privtag leave %x %y %X %Y]
+	    +[list [namespace current]::balloon [double% $w] [double% $privtag] leave %x %y %X %Y]
     }
 
     # Default URL action:

Modified: trunk/tkabber/plugins/roster/annotations.tcl
===================================================================
--- trunk/tkabber/plugins/roster/annotations.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/roster/annotations.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -223,10 +223,10 @@
     }
     $f.sw setwidget $f.note
 
-    bind $f.note <Control-Key-Return> "$w invoke default
+    bind $f.note <Control-Key-Return> "[double% $w] invoke default
 				       break"
     bind $w <Key-Return> { }
-    bind $w <Control-Key-Return> "$w invoke default
+    bind $w <Control-Key-Return> "[double% $w] invoke default
 				  break"
 
     $w draw $f.note

Modified: trunk/tkabber/plugins/unix/dockingtray.tcl
===================================================================
--- trunk/tkabber/plugins/unix/dockingtray.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/unix/dockingtray.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -72,7 +72,7 @@
 
     bind $mb <ButtonRelease-1> ifacetk::systray::restore
     bind $mb <ButtonRelease-2> ifacetk::systray::withdraw
-    bind $mb <ButtonRelease-3> [list tk_popup $m %X %Y]
+    bind $mb <ButtonRelease-3> [list tk_popup [double% $m] %X %Y]
     balloon::setup $icon -command [list ifacetk::systray::balloon $icon]
 }
 

Modified: trunk/tkabber/plugins/unix/systray.tcl
===================================================================
--- trunk/tkabber/plugins/unix/systray.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/unix/systray.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -72,7 +72,7 @@
 
     bind $icon <ButtonRelease-1> ifacetk::systray::restore
     bind $icon <ButtonRelease-2> ifacetk::systray::withdraw
-    bind $icon <ButtonRelease-3> [list tk_popup $m %X %Y]
+    bind $icon <ButtonRelease-3> [list tk_popup [double% $m] %X %Y]
     balloon::setup $icon -command [list ifacetk::systray::balloon $icon]
 }
 

Modified: trunk/tkabber/plugins/unix/tktray.tcl
===================================================================
--- trunk/tkabber/plugins/unix/tktray.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/plugins/unix/tktray.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -66,7 +66,7 @@
 
     bind $icon <ButtonRelease-1> ifacetk::systray::restore
     bind $icon <ButtonRelease-2> ifacetk::systray::withdraw
-    bind $icon <ButtonRelease-3> [list tk_popup $m %X %Y]
+    bind $icon <ButtonRelease-3> [list tk_popup [double% $m] %X %Y]
     balloon::setup $icon -command [list ifacetk::systray::balloon $icon]
 }
 

Modified: trunk/tkabber/privacy.tcl
===================================================================
--- trunk/tkabber/privacy.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/privacy.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -62,11 +62,9 @@
 }
 
 
-proc privacy::on_destroy_dialog {w W} {
+proc privacy::on_destroy_dialog {} {
     variable data
 
-    if {$w != $W} return
-    
     catch { array unset data }
 }
 
@@ -89,8 +87,10 @@
 	-modal none -separator 1 -anchor e \
 	-default 0 -cancel 1
 
-    bind $w <Destroy> [list [namespace current]::on_destroy_dialog $w %W]
+    set f [$w getframe]
 
+    bind $f <Destroy> [list [namespace current]::on_destroy_dialog]
+
     $w add -text [::msgcat::mc "Send"] \
 	-command [list [namespace current]::send_lists $xlib $w]
     $w add -text [::msgcat::mc "Cancel"] -command [list destroy $w]

Modified: trunk/tkabber/pubsub.tcl
===================================================================
--- trunk/tkabber/pubsub.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/pubsub.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -365,9 +365,10 @@
 	-command [list [namespace current]::send_entities \
 		       $xlib $service $node $w $f]
     $w add -text [::msgcat::mc "Cancel"] -command [list destroy $w]
-    bind $w <Destroy> \
-	 [list after idle [list [namespace current]::cleanup_entities $w $f]]
 
+    bind $f <Destroy> \
+	 [list [namespace current]::cleanup_entities %W]
+
     button $w.add -text [::msgcat::mc "Add"] \
 	-command [list [namespace current]::list_add_item $sf $f]
     pack $w.add -side bottom -anchor e -in $wf -padx 1m -pady 1m
@@ -589,7 +590,7 @@
     destroy $w
 }
 
-proc pubsub::cleanup_entities {w f} {
+proc pubsub::cleanup_entities {f} {
     variable listdata
     variable origlistdata
 

Modified: trunk/tkabber/register.tcl
===================================================================
--- trunk/tkabber/register.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/register.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -46,8 +46,8 @@
 	-command [namespace code [list Unregister $w $xlib $jid]] \
         -state disabled
     $bbox add -text [::msgcat::mc "Cancel"] -command [list destroy $w]
-    bind $w <Return> "ButtonBox::invoke $bbox default"
-    bind $w <Escape> "ButtonBox::invoke $bbox 2"
+    bind $w <Return> "ButtonBox::invoke [double% $bbox] default"
+    bind $w <Escape> "ButtonBox::invoke [double% $bbox] 2"
     pack $bbox -padx 2m -pady 2m -anchor e -side bottom
 
     pack $sep -side bottom -fill x -pady 1m
@@ -55,7 +55,7 @@
     pack $vf -side left -pady 2m
     pack $sw -side top -expand yes -fill both -padx 2m -pady 2m
 
-    bind $f <Destroy> [list data::cleanup $f]
+    bind $f <Destroy> [list data::cleanup %W]
 
     wm withdraw $w
 
@@ -176,8 +176,8 @@
     $bbox add -text [::msgcat::mc "Submit"] \
 	-command [namespace code [list Password $w $f $xlib]]
     $bbox add -text [::msgcat::mc "Cancel"] -command [list destroy $w]
-    bind $w <Return> "ButtonBox::invoke $bbox default"
-    bind $w <Escape> "ButtonBox::invoke $bbox 1"
+    bind $w <Return> "ButtonBox::invoke [double% $bbox] default"
+    bind $w <Escape> "ButtonBox::invoke [double% $bbox] 1"
     pack $bbox -padx 2m -pady 2m -anchor e -side bottom
 
     pack $sep -side bottom -fill x -pady 1m
@@ -185,7 +185,7 @@
     pack $vf -side left -pady 2m
     pack $sw -side top -expand yes -fill both -padx 2m -pady 2m
 
-    bind $f <Destroy> [list data::cleanup $f]
+    bind $f <Destroy> [list data::cleanup %W]
 
     set fields \
 	[list instructions [::msgcat::mc "Enter the new password for %s" \
@@ -240,8 +240,8 @@
 	    destroy $w.bbox
 	    set bbox [ButtonBox $w.bbox -spacing 0 -padx 10 -default 0]
 	    $bbox add -text [::msgcat::mc "Close"] -command [list destroy $w]
-	    bind $w <Return> "ButtonBox::invoke $bbox default"
-	    bind $w <Escape> "ButtonBox::invoke $bbox 0"
+	    bind $w <Return> "ButtonBox::invoke [double% $bbox] default"
+	    bind $w <Escape> "ButtonBox::invoke [double% $bbox] 0"
 	    pack $bbox -padx 2m -pady 2m -anchor e -side bottom -before $w.sep
 	}
 	continue {
@@ -256,8 +256,8 @@
 	    $bbox add -text [::msgcat::mc "Submit"] \
 		-command [namespace code [list Register $w $f $xlib $jid false]]
 	    $bbox add -text [::msgcat::mc "Cancel"] -command [list destroy $w]
-	    bind $w <Return> "ButtonBox::invoke $bbox default"
-	    bind $w <Escape> "ButtonBox::invoke $bbox 1"
+	    bind $w <Return> "ButtonBox::invoke [double% $bbox] default"
+	    bind $w <Escape> "ButtonBox::invoke [double% $bbox] 1"
 	    pack $bbox -padx 2m -pady 2m -anchor e -side bottom -before $w.sep
 
 	    RecvFields $w $f $xlib $jid ok $xml

Modified: trunk/tkabber/richtext.tcl
===================================================================
--- trunk/tkabber/richtext.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/richtext.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -119,18 +119,16 @@
     set state($w,types) [lsort -command compare_entity_prios $using]
 
     # Register a kind of "destructor" to clean up state:
-    bind $w <Destroy> +[list [namespace current]::richtext_on_destroy $w %W]
+    bind $w <Destroy> +[list [namespace current]::richtext_on_destroy %W]
 }
 
 # Cleans up state of richtext widgets:
-proc richtext::richtext_on_destroy {w1 w2} {
-    if {$w1 != $w2} return
-
+proc richtext::richtext_on_destroy {w} {
     variable state
     variable texts
 
-    lexclude texts $w1
-    array unset state $w1,*
+    lexclude texts $w
+    array unset state $w,*
 }
 
 proc richtext::textlist {} {
@@ -351,8 +349,8 @@
 
     # Handlers of CLIPBOARD selections
     # (subvert tk_textCopy and tk_textCut)
-    bind $w <<Copy>> [list [namespace current]::text_copy $w]
-    bind $w <<Cut>>  [list [namespace current]::text_cut $w]
+    bind $w <<Copy>> [list [namespace current]::text_copy %W]
+    bind $w <<Cut>>  [list [namespace current]::text_cut %W]
 }
 
 proc richtext::render_text {w type piece tags} {

Modified: trunk/tkabber/search.tcl
===================================================================
--- trunk/tkabber/search.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/search.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -38,8 +38,8 @@
 		 -command [list destroy $sw]
     pack $sw.bbox -padx 2m -pady 2m -anchor e -side bottom
 
-    bind $sw <Return> [list ButtonBox::invoke $sw.bbox default]
-    bind $sw <Escape> [list ButtonBox::invoke $sw.bbox 1]
+    bind $sw <Return> [list ButtonBox::invoke [double% $sw.bbox] default]
+    bind $sw <Escape> [list ButtonBox::invoke [double% $sw.bbox] 1]
 
     Separator::create $sw.sep -orient horizontal
     pack $sw.sep -side bottom -fill x -pady 1m
@@ -47,7 +47,7 @@
     frame $sw.fields -class Search
 
     pack $sw.fields -expand yes -fill both -anchor nw -padx 2m -pady 2m
-    bind $sw.fields <Destroy> [list data::cleanup $sw.fields]
+    bind $sw.fields <Destroy> [list data::cleanup %W]
 
     ::xmpp::search::request $xlib $jid \
 		-command [namespace code [list RecvFields $sw $xlib $jid]]
@@ -151,8 +151,8 @@
 			   destroy [list $sw]"
     pack $rw.bbox -padx 2m -pady 2m -anchor e -side bottom
 
-    bind $rw <Return> [list ButtonBox::invoke $rw.bbox default]
-    bind $rw <Escape> [list ButtonBox::invoke $rw.bbox 1]
+    bind $rw <Return> [list ButtonBox::invoke [double% $rw.bbox] default]
+    bind $rw <Escape> [list ButtonBox::invoke [double% $rw.bbox] 1]
 
     Separator::create $rw.sep -orient horizontal
     pack $rw.sep -side bottom -fill x -pady 1m
@@ -169,12 +169,12 @@
     $sww setwidget $sww.listbox
 
     set lastsort($sww.listbox) ""
-    bind $sww.listbox <Destroy> +[list [namespace current]::DeleteLastsort $sww.listbox]
+    bind $sww.listbox <Destroy> +[list [namespace current]::DeleteLastsort %W]
     
     bind $sww.listbox <3> \
-	"[namespace current]::SelectAndPopupMenu [list $sww.listbox] \
-	     \[$sww.listbox nearest \[::mclistbox::convert %W -y %y\]\] \
-	     $xlib"
+	"[namespace current]::SelectAndPopupMenu [list [double% $sww.listbox]] \
+	     \[[double% $sww.listbox] nearest \[::mclistbox::convert %W -y %y\]\] \
+	     [double% $xlib]"
 
     bindscroll $sww $sww.listbox
 
@@ -247,7 +247,7 @@
 				    set width($col) [string length " $l "]
 				    set name($col) $var
 				    $w column add $var -label " $l "
-				    $w label bind $var <ButtonPress-1> [namespace code [list Sort %W $var]]
+				    $w label bind $var <ButtonPress-1> [namespace code [list Sort %W [double% $var]]]
 				    set lasttag $var
 
 				    incr col

Modified: trunk/tkabber/splash.tcl
===================================================================
--- trunk/tkabber/splash.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/splash.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -147,8 +147,8 @@
     grid $w.frame.msg   -row 0 -column 2 -sticky w -padx 4m -pady 4m
 
     if {$aboutP} {
-	bind $w <ButtonPress> ""
-	bind $w <ButtonRelease> "destroy $w"
+	bind $w <ButtonPress> {}
+	bind $w <ButtonRelease> [list destroy %W]
     } else {
 	ProgressBar $w.frame.bar     \
 	    -variable   splash_count \

Modified: trunk/tkabber/userinfo.tcl
===================================================================
--- trunk/tkabber/userinfo.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/userinfo.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -205,8 +205,8 @@
 		userinfo::send_vcard [list $xlib] [list $jid]
 		destroy [list $w]
 	"
-	bind $w <Return>  "ButtonBox::invoke $bbox default"
-	bind $w <Escape> "ButtonBox::invoke $bbox 1"
+	bind $w <Return> [list ButtonBox::invoke [double% $bbox] default]
+	bind $w <Escape> [list ButtonBox::invoke [double% $bbox] 1]
 	$bbox add -text [::msgcat::mc "Cancel"] -command [list destroy $w]
 
 	set sep [Separator::create $w.sep -orient horizontal]
@@ -319,7 +319,7 @@
 	bind $a.text <Key-Return> [bind Text <Key-Return>]
 	bind $a.text <Key-Return> +break
 	bind $a.text <Control-Key-Return> "
-	    ButtonBox::invoke $bbox default
+	    ButtonBox::invoke [double% $bbox] default
 	    break
 	"
     }
@@ -420,8 +420,8 @@
 
     $tab compute_size
 
-    bind $w <Control-Prior> [list ifacetk::tab_move $tab -1]
-    bind $w <Control-Next> [list ifacetk::tab_move $tab 1]
+    bind $w <Control-Prior> [list ifacetk::tab_move [double% $tab] -1]
+    bind $w <Control-Next> [list ifacetk::tab_move [double% $tab] 1]
 
     $tab raise $top_page
 

Modified: trunk/tkabber/utils.tcl
===================================================================
--- trunk/tkabber/utils.tcl	2009-05-09 13:40:07 UTC (rev 1803)
+++ trunk/tkabber/utils.tcl	2009-05-09 16:00:44 UTC (rev 1804)
@@ -215,9 +215,12 @@
 
 proc bindscroll {w {w1 ""}} {
 
-    if {[cequal $w1 ""]} {
-	set w1 $w
+    if {![string equal $w1 ""]} {
+	set w1 [double% $w1]
+    } else {
+	set w1 [double% $w]
     }
+
     bind $w <<ScrollUp>> \
 	"if {\[lindex \[$w1 yview\] 0\] > 0} {
 	    $w1 yview scroll -5 units
@@ -339,11 +342,11 @@
     $sw setwidget $sf
     set sff [$sf getframe]
 
-    bind $path <Key-Up> [list focus_prev %W $sf]
-    bind $path <Key-Down> [list focus_next %W $sf]
-    bind $path <Key-Tab> [list focus_next %W $sf]
-    bind $path <Shift-Tab> [list focus_prev %W $sf]
-    bind $path <<PrevWindow>> [list focus_prev %W $sf]
+    bind $path <Key-Up> [list focus_prev %W [double% $sf]]
+    bind $path <Key-Down> [list focus_next %W [double% $sf]]
+    bind $path <Key-Tab> [list focus_next %W [double% $sf]]
+    bind $path <Shift-Tab> [list focus_prev %W [double% $sf]]
+    bind $path <<PrevWindow>> [list focus_prev %W [double% $sf]]
     bindscroll $sff $sf
 
     if {!$radio} {
@@ -370,7 +373,7 @@
 	    set cb [checkbutton $sff.cb$i -variable ${var}($idx) \
 		-text $names($idx)]
 	}
-	bind $cb <Return> [list $path invoke 0]
+	bind $cb <Return> [list [double% $path] invoke 0]
 	bind $cb <Return> +break
 	bind $cb <1> [list focus %W]
 	bindscroll $cb $sf



More information about the Tkabber-dev mailing list