[Tkabber-dev] r866 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Jan 8 17:20:40 MSK 2007


Author: sergei
Date: 2007-01-08 17:20:37 +0300 (Mon, 08 Jan 2007)
New Revision: 866

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/general/tkcon.tcl
Log:
	* plugins/general/tkcon.tcl: Adapted to use tkcon as a Tcl package.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-01-06 17:12:23 UTC (rev 865)
+++ trunk/tkabber/ChangeLog	2007-01-08 14:20:37 UTC (rev 866)
@@ -1,3 +1,7 @@
+2007-01-08  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/general/tkcon.tcl: Adapted to use tkcon as a Tcl package.
+
 2007-01-06  Sergei Golovan  <sgolovan at nes.ru>
 
 	* README, doc/tkabber.xtml, doc/tkabber.xml: Documented changes in

Modified: trunk/tkabber/plugins/general/tkcon.tcl
===================================================================
--- trunk/tkabber/plugins/general/tkcon.tcl	2007-01-06 17:12:23 UTC (rev 865)
+++ trunk/tkabber/plugins/general/tkcon.tcl	2007-01-08 14:20:37 UTC (rev 866)
@@ -9,8 +9,13 @@
 #
 #     % tkcon.tcl -name tkabber -exec "" -root .tkconn -main "source tkabber.tcl"
 #
+# or if tkcon is installed as a Tcl package and can be sourced via
+# [package require] (tkcon isn't loaded at start, so it doesn't waste resources
+# if it's unneeded)
+#
 
-if {[llength [info commands ::tkcon::*]] <= 0} {
+if {[lempty [package versions tkcon]] && \
+	[llength [info commands ::tkcon::*]] <= 0} {
     return
 }
 
@@ -23,7 +28,7 @@
 	set ndx [.menubar index [::msgcat::mc "Help"]]
 	set menu [.menubar entrycget $ndx -menu]
 	$menu add separator
-	$menu add checkbutton -label [::msgcat::mc "Show console"] \
+	$menu add checkbutton -label [::msgcat::mc "Show TkCon console"] \
 	      -command  [namespace current]::show_console \
 	      -variable [namespace current]::showP
 	show_console
@@ -33,11 +38,16 @@
 proc tkcon::show_console {} {
     variable showP
 
+    if {[llength [info commands ::tkcon::*]] <= 0} {
+	package require tkcon
+    }
+
     if {$showP} {
-	wm state $::tkcon::PRIV(root) normal
+	tkcon show
     } else {
-	wm state $::tkcon::PRIV(root) withdrawn
+	tkcon hide
     }
 }
 
 hook::add finload_hook [namespace current]::tkcon::add_tkcon_to_tkabber_menu
+



More information about the Tkabber-dev mailing list