Version 1 of txmbox

Updated 2006-09-09 20:14:36

txmbox is an attempt to provide a general purpose informational dialog tool to replace tk_messageBox. txmbox adheres to all the tk_messageBox options, improving on many of them. Also, txmbox adds so many additional features that you may never need to build another informational dialog box. txmbox is a psuedo widget. The only exception to compatibility with tk_messageBox; the default for -icon is to not display an icon.

Here's a list of most of the features included in this package:

  • Uses Tile widgets if the Tile package is already loaded so your dialogs will look like the rest of your interfaces.
  • Keeps the event loop running. Doesn't hang your program.
  • Dialogs can timeout after a predefined period AND you can optionally choose to show the remaining time in the dialog's title bar.
  • Dialog buttons can be pressed programmatically.
  • Dialog button labels can be changed after the dialog has been displayed.
  • txmbox is written in Tcl so you can easily extend it's capability.
  • Dialogs can be made to wait for the user to respond or not. If the dialog is instructed to wait then, after the user clicks a button, the button label of the pressed button is returned. If the dialog is instructed not to wait then the call to the dialog returns the dialog windows path, ie; .txmboxXYZ.
  • The message widget is a text widget so it's text can easily be copied and pasted into other applications or emails. In fact, I'm looking at adding printing capability via a button 3 popup dialog. There's already a b3 popup that allows you to select all text and copy it to the cut buffer. Also, the text widget is disabled so the user can't mess with the message text.
  • You can have multiple instances of txmbox on the screen at one time.
  • New text can be added dynamically to existing dialogs AND you can set the foreground and background colors as you add new text.
  • Each dialog can be associated with a callback routine.
  • You may specify the complete geometry of the dialog or just it's size or position.
  • The dialog's position can be queried and saved so it can be repositioned according to the user's desire the next time it's presented.
  • Includes a built-in "Don't show this dialog again" function.
  • Includes an optional text formatting function.
  • Can wait for a known process ID to terminate.
  • Can be displayed without a titlebar.
  • Dialogs can be resized.
  • Can have a confirm sub-dialog. You know the old "Are you sure you want to do this?" Bill Gates really likes these.
  • Add an image or icon to the left side of the message. Uses the standard bitmap icons available in Tcl or you can supply your own images.
  • Can make a sound when dialog pops up.
  • Can be centered or otherwise positioned.
  • Can have custom button names OR use predefined button sets.
  • Dialog's information is retained after dialog is closed so it can be processed post dialog. Used memory can be recovered via the cleanMsgBox command.
  • Cross platform compliant. Works on Windows, Linux, and UNIX. It hasn't been tested on a Mac platform so I have no idea whether it will work there but I sure would like to get some feedback.
  • Extensive error checking.
  • The package also includes some useful routines that can be accessed separately from the messageBox.

You can get a copy of it here http://doveware.com/txmbox1.0.zip

I hope you find it useful and please let me know if you have any feature request or find any bugs.