TkChat

TkChat is an XMPP (Jabber) chat client for the Tcl Chatroom and which implements The Next Generation Tcl Chatroom. Tkchat provides several features specific to the Tcl community.

https://web.archive.org/web/20151130031516/tkchat.tcl.tk/tkchat-small.png


Jeff Smith 2019-10-31 : Below is an online demo using CloudTk. This demo runs TkChat in an Alpine Linux Docker Container. It is a 21.5MB image which is made up of Alpine Linux + tclkit + tkchat.kit + tls1.7.18 + libx11 + libxft + fontconfig. It is run under a user account in the Container. The Container is restrictive with permissions for "Other" removed for "execute" and "read" for certain directories.


Attributes

website
http://tkchat.tcl.tk
website alias
http://tkchat.tclers.tk
website maintainer
rmax
code repository
https://core.tcl-lang.org/tclapps

Getting tkchat

You can verify the download by fetching the gpg signature and validating with the authors' gpg key . The windows starpack exe has also been AuthentiCode signed with a key issued by patthoyts.tk .

TkChat is distributed as a starkit and as a starpack for Microsoft Windows. The latest version is always at http://tkchat.tcl.tk/files/tkchat.kit and the Windows starpack can be found at tkchat.tcl.tk/tkchat.exe . The distribution site also holds a number of older versions in case there is a problem with a particular release.

As of 2016-01-08, the latest version of tkchat for Mac is at codebykevin.com/tkchat.zip , rather than on the tkchat website.

TkChat requires a particular version of jabberlib, which can should get this from the tclers.tk website. You will also need a few packages from tcllib and tklib. The simplest method to get everything working is to fetch the starkit and unwrap it using sdx unwrap tkchat.kit. Then replace the bin subdirectory with a cvs checkout of tkchat and run this using tclkit tkchat.vfs/main.tcl

Stu 2018-06-11 Now there's a "thatched" TkChat single-file standalone program that only needs Tcl/Tk. See the Thatch page for more info/download.

Installing TkChat

On OS X, opening TkChat.app may result in the following error

You can't open the application TkChat.app because it may be damaged or incomplete

Until this is fixed, the workaround is to invoke /Applications/TkChat.app/Contents/MacOS/tkchat.sh instead

bll 2019-11-2 This is usually indicative of a bad or corrupt download. Remove the old .app file completely and re-download and re-install.

Logging In

When you start tkchat the first time, you will see a window like this:

https://web.archive.org/web/20151130011422/tkchat.tcl.tk/tkchat-logon.png

Simply enter (your) username and password and click on the logon. Your username does not need to be the same as your nickname, you can change it later on If your account doesn't exist yet, you will be prompted to creating one using the registration dialog:

https://web.archive.org/web/20151129164720/tkchat.tcl.tk/tkchat-register.png

If your registration fails then a notice to this effect is printed in the tkchat chat area and you should try again with a different user name.

Note that as of 2011-08, at least, new-user registration has been disabled due to abuse. If you are sufficiently well-known on the irc channel, you can request an account, or you can use another xmpp server. There has been some trouble reported when trying to use TkChat with talk.google.com

Configuration

Use Proxy

tkchat can connect through an HTTP proxy server which supports the CONNECT method. You will almost certainly need to use an SSL connection for that, see at Use Jabber SSL below for more.

Enter the proxy details (ask your network admin or peek in your web browser settings), some proxies need a username and a password too, but most don't.

Remember Chat Password

This will save your password for the next time you start tkchat. If you enable this, you may also enable Auto-connect.

Jabber resource

You can change the jabber resource to 'work' or 'home' or something else, this allows you to log in from two computers at the same time, and be in the chat room with two times (with different nicknames). The resource will be appended to your nickname if when you try to transfer the nick from another location using the /nick command (see Commands below).

Jabber server:port

You can log into a different jabber server and still join the chat. The default is all.tclers.tk 5222. Another popular jabber server is jabber.org. Currently tkchat is not able to login to Google Talk accounts.

Use Jabber SSL

You can encrypt the connection between your computer and the jabber server. Most useful for proxies, but you can enable it for direct connections too. When enabling, set the Jabber server:port to use port 443 (the default is 5222 or 5223).

You will need to download https://www.tcl-lang.org/starkits/tls.kit and save it next to your tkchat.kit. If tkchat was running already you will need to restart it after the download has finished. The Windows starpack version already contains the tls extension so this is not necessary if you are using that version.

Use it to encrypt your traffic, remember, though that the tcler's chat is a public chat room.

Auto-connect

When enabled, the logon dialog will not be shown on startup, but you will automatically log in when you start tkchat. You must also enable Remember Chat Password for this to work.

Now choose the Logon button, and you're done!

Chatting with tkchat

Just type a message in the entry line at the bottom of your chat window and hit the enter key. It is that simple!

If you want to type a message with more than one line in it (as opposed to one long line, which automatically wraps), use the >> button to get a larger entry field, and click on the Post button to send your message. This is most useful for short pieces of code. For longer bits of code you should use the paste dialog accessed by typing Control-P or selecting from the chat area context menu. This will send your text to the web site at http://paste.tclers.tk/ and reply to you with the url of your pasted data.

If you want to send a message to a single user you can click on their name in the Online Users list. This will open a new dialog which provides one-to-one chat with that user. Right-clicking on a users name shows a context menu which can let you view their user information, chat client version and sometimes additional details. You may also use the combo box to the right of the Post button. By default it has All Users, but you can change it to any of the online users. Your message line will be pink-ish to indicate you are not talking to everyone.

Commands

If your message starts with a /, tkchat will try to see if it is a command.

/me <message>Makes you perform an 'action', your message is displayed as: * yourname <message>
/ot <message>Make an off-the-record remark, your message will not be stored in the server chatlog (this doesn't mean that nobody is logging it!).
/otme <message>Do an off-the-record action (like /me).
/msg <nickname> <message>
/whisper <nickname> <message>
Send a private message to user nickname.
/chat <nickname> ?message?Open a separate window to privately chat with the user identified by nickname, optionally posting an initial message.
/memo <[email protected]> <message>Send a private message to user [email protected]. If the user is currently not logged in the message should be stored and presented next time she logs in.
/afk ?reason?
/away ?reason?
Set your status to away from keyboard because of reason.
/dnd ?reason?
/busy ?reason?
Set your status to busy because of reason.
/back ?reason?Indicate that you have returned.
/nologAll messages and actions you type after /nolog are marked 'off-the-record'
/logWhen you are done talking about your family, you can mark your messages to be recorded again.
/nick <newnickname>Changes your nickname to newnickname, if that is still available. If the newnickname is in use by one of your other tkchat windows, tkchat will request the other window to release the nickname. You chat window will wait for the nick to become available, and grab it when it can.
/noisy ?nick? ?minutes?Toggle nick noisy for minutes (default 5). Messages from noisy users are not displayed. Not specifying a nick will give you a list of noisy users.
/last <nickname>Query special user ijchain when user nickname was last seen.
/?<search>Searches the chat window for search (backwards!). Repeating the search will find the next occurrence.
/!Clears the search and moves back to the end of the chat buffer.
/helpOpens this wiki page in your web browser.

Tcl community / utility commands

/tip <number>Open a webbrowser with the specific TIP page (Tcl Improvement Proposal), try /tip 1 to get more info.
/bug ?group? ?tracker? <number>Open the sourceforge page for the Tcl/Tk bug/feature request number.
/wiki <search>Search the Tcler's Wiki for the search string.

Miscellaneous commands

/google <search>Open a webbrowser and do a google search.
/googlefight <word1> <word2>Open a webbrowser and perform a google fight between two words or phrases.
/wikipedia <text>Open a webbrowser and send a query to wikipedia (abbr. /wikip <text>).
/wiktionary <text>Open a webbrowser and send a query to wikipedia dictionary (abbr. /wikid <text>).
/smileysShow the available smiley images.
/fontsize <number>
/size <number>
Change the chat window's font to size number.
/font ?name?Change the chat window's font to family name. Omitting name will open the font chooser dialog, where available.
/userinfo <nickname>Display registered information for user nickname (see below).

User info / Hide user

Users can put some info about themselves on the jabber server. To see these, do a right-click (from version 1.313 on MacOS X: Command-click) on the name in the user list (the right panel of tkchat). There comes a menu from which you can choose User info and Hide user. Double-clicking the item opens a new window for a one-to-one chat.

Chat history

When you log on, tkchat will ask you how much chat history you want to load. In the preferences menu, there is an option "Loading server history". You can use this to specify how much, if any, history you want to load on start up.

Plug-ins

New features are now added using a plug-in interface. The clock plug-in (file tkchat_clock.tcl) is a good guide for writing a new plug-in. The following picture shows a number of plug-ins operating in the tkchat status bar.

https://web.archive.org/web/20151129220749/tkchat.tcl.tk/tkchat-statusbar.png

First on the left is the streaming audio plug-in which has some basic controls and a power-meter. Then the clock plug-in is showing the time in Bangkok (the format was configured to show a prefix of BNK and the timezone set for a user in the UK). Next is the RSS plugin, in this case the icon is bright showing that there are available un-read messages and indeed the tooltip lets the user know just what channel and how many messages are ready. Then there is a network connection icon that shows our connection state and displays the address of the connected server in a tooltip. Finally the padlock icon shows the secure state of the link next to the jabber server name. Clicking this icon permits the user to review the certificate chain in use provided the link is secured using SSL.

Streaming video

This plugin requires some parts of the img extension. If the jpeg image support can be loaded then the plugin installs itself in the File menu under Video feeds. A dialog permits you to add new streams or you can select a previously added stream from the menu (if any are shown).

Once a stream has been selected a new toplevel window will open displaying the video stream.

Streaming audio

If the snack audio extension can be loaded then the streaming audio plugin will install itself in the File menu as Play audio. A dialog can be used to add additional stream sources to the menu and by default there are a few internet radio streams listed (not all may be operating all the time and they may vanish over time).

The user may also select MP3 files using the Play file... menu item.

Once an audio stream or file has been selected a small audio control is displayed in the status bar. This permits the user to control the volume via a slider in the center of the control and to pause, stop or restart the stream. It may also show audio levels using a powermeter style display.

Clock

The clock plug-in adds a page to the Options dialog (accessed from the Preferences menu). On this page the user may configure a timezone offset and a display format string. Once enabled this causes the time in the provided timezone to be displayed in the statusbar. The default is to display the time as UTC time.

RSS Feeds

The RSS plug-in adds a page to the Options dialog where the user can enable or disable a small number of RSS feeds. The feeds are checked every 20 minutes and if new information is available on one of the monitored streams then the statusbar will show an active RSS icon (the same icon used in Firefox and IE). Clicking on the RSS icon will raise a dialog showing each RSS feed in a separate tabbed page.

Chat logs

The tkchat logs are stored at http://tclers.tk/conferences/tcl/

The logs are quite nice to do some TkChatistics on.

Improving TkChat on OSX

DKF: A few people are working on improving the look and feel of tkchat on MacOS X. Here is a list of some of the features being worked on...

  • growl interface, based on a rewritten version of Kevin W's macgrowl (rewritten so it can run out of a starkit)
  • dock icon bouncing using "wm attributes -notify"
  • About and Preferences hacked into the TkChat menu
  • a dock icon which changes when unseen messages (use's Kevin W's tkdock)
  • created an .app bundle
  • a proper preferences dialog (the TkChat/Preferences menu option just posts the preferences menu at 20,30), including
    • getting the plethora of options off most of the menus where they had been silting up
    • spacing things out to avoid the cramped-ness of the existing dialog
  • a DMG image containing the .app
  • a better Info.plist
  • keyboard bindings
  • apple help services bindings

(This list is incomplete and will probably be migrated elsewhere. It's just so that we can keep a note of what needs to be done.)

Known Issues

On MacOS X Mavericks the current build of TkChat has issues with text boxes not repainting properly. As a workaround you can start the application in 32-bit mode by editing /Applications/TkChat.app/Contents/MacOS/tkchat.sh and replacing the "exec" command with:

arch -i386 "$dir/tclkit" "$dir/tkchat.kit" $*

The fonts may also look blurry on Retina displays. This can be fixed by editing /Applications/TkChat.app/Contents/info.plist to add:

<key>NSHighResolutionCapable</key> <string>True</string>

You then need to copy the TkChat application from /Applications to somewhere else (Option+Drag), delete the version in /Applications and then move the copy back. This will force Mac OS X to re-read the info.plist.

New Build for OS X Mavericks

Kevin Walzer has put together a new build of TkChat for OS X Mavericks that incorporates recent bug fixes in Tcl/Tk and is better optimized for Retina displays. Download it here: [L1 ]

New Build for OS X Yosemite

Kevin Walzer has put together a new build of TkChat for OS X Yosemite that incorporates the major re-work of Tk on the Mac to remove private API's and port buttons and scrollbars to the HITheme API, as well as updating the Tk version to 8.6. Download it here: [L2 ]

See Also

Tclers Chat Tk GUI
Improving Tcl Chat
tclapps
TkChat - A History
the evolution of TkChat