[Tkabber-dev] r754 - in trunk/tkabber: . plugins/chat plugins/unix

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Oct 10 11:24:01 MSD 2006


Author: sergei
Date: 2006-10-10 11:23:56 +0400 (Tue, 10 Oct 2006)
New Revision: 754

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/chat/completion.tcl
   trunk/tkabber/plugins/unix/ispell.tcl
Log:
	* plugins/chat/completion.tcl: Made workaround for XIM in
	  chat input windows. Instead of binding %A to any key and
	  query if the symbol is empty (which does not work if XIM is
	  used because of known bug in Tk) Tkabber compares two indices,
	  before and after keypress, and if they are the same then the
	  symbol is thought as empty.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-10-09 20:24:44 UTC (rev 753)
+++ trunk/tkabber/ChangeLog	2006-10-10 07:23:56 UTC (rev 754)
@@ -1,3 +1,12 @@
+2006-10-10  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/chat/completion.tcl: Made workaround for XIM in
+	  chat input windows. Instead of binding %A to any key and
+	  query if the symbol is empty (which does not work if XIM is
+	  used because of known bug in Tk) Tkabber compares two indices,
+	  before and after keypress, and if they are the same then the
+	  symbol is thought as empty.
+
 2006-10-09  Sergei Golovan  <sgolovan at nes.ru>
 
 	* ifacetk/iface.tcl: Don't add message to tab or window

Modified: trunk/tkabber/plugins/chat/completion.tcl
===================================================================
--- trunk/tkabber/plugins/chat/completion.tcl	2006-10-09 20:24:44 UTC (rev 753)
+++ trunk/tkabber/plugins/chat/completion.tcl	2006-10-10 07:23:56 UTC (rev 754)
@@ -240,10 +240,17 @@
     set completion(state,$chatid) normal
 }
 
-proc completion::on_keypress {chatid key} {
+proc completion::on_keypress {chatid} {
+    set iw [chat::input_win $chatid]
+    after idle \
+	  [list [namespace current]::on_keypress1 $chatid [$iw index insert]]
+}
+
+proc completion::on_keypress1 {chatid idx} {
     variable completion
 
-    if {$key != ""} {
+    set iw [chat::input_win $chatid]
+    if {[$iw index insert] != $idx} {
 	set completion(state,$chatid) normal
     }
 }
@@ -265,7 +272,7 @@
     bind $cc <Key-Return> \
 	[list [namespace current]::delete_suffix [double% $chatid]]
     bind $cc <KeyPress> \
-	[list [namespace current]::on_keypress [double% $chatid] %A]
+	[list [namespace current]::on_keypress [double% $chatid]]
 }
 
 hook::add open_chat_post_hook [namespace current]::completion::setup_bindings

Modified: trunk/tkabber/plugins/unix/ispell.tcl
===================================================================
--- trunk/tkabber/plugins/unix/ispell.tcl	2006-10-09 20:24:44 UTC (rev 753)
+++ trunk/tkabber/plugins/unix/ispell.tcl	2006-10-10 07:23:56 UTC (rev 754)
@@ -272,5 +272,5 @@
     $iw tag configure combo -foreground [option get [winfo parent $iw] comboColor Chat]
 }
 
-hook::add open_chat_post_hook [namespace current]::ispell::setup_bindings
+#hook::add open_chat_post_hook [namespace current]::ispell::setup_bindings
 



More information about the Tkabber-dev mailing list