Open-Source Packages

Code by Kevin has developed several open-source Tcl/Tk packages to improve the Mac look-and-feel of our software. All packages are developed under Tcl/Tk's BSD-style license (http://www.tcl.tk/software/tcltk/license.html). In hopes that other developers might make use of these packages, they are documented and available for download below. All packages require Tk 8.5.

The Aquahig Package

The Aquahig package implements some Mac OS X-specific configurations to selected Tk megawidgets to make them better fit in visually with Mac interface conventions, similar to iTunes and other Mac applications. Currently supported widgets are the BWidgets Tree, the BWidgets ListBox, and Tablelist.

Using the Aquahig Package

The aquahig package is invoked by calling package require aquahig. It implements Mac styling for widgets in the form of arrays:

Usage of the package would look something like this:

foreach {key value} [array get aquahig::treeopts] {
$w configure -$key $value
}

Note: the aquahig package depends on the TkImg or TkPNG packages, as the Mac-style disclosure triangles are pngs. To use another image format, such as .gif, you will need to edit the source code accordingly.

Download aquahig

The Macgrowl Package

The macgrowl package is a high-level Tcl wrapper for the Growl notification system on OS X (http://growl.info). It interfaces with Growl via AppleScript, and provides hooks to post Growl notifications. (Growl also comes with an older Tcl binding that requires building from source, but it is unsupported and will not compile against recent versions of Growl.)

Using the Macgrowl Package

The macgrowl package is called via package require macgrowl, and defines the following commands:

Note: Growl is not installed on Mac OS X by default, so it is a good idea to check for a Growl installation before calling the macgrowl package. This Tcl procedure will check to see if Growl is running:

#check to see if growl is running
proc checkGrowl {} {
global growlrunning
set growlrunning [exec osascript -e {
tell application "System Events"
set isRunning to (count of (every process whose name is "GrowlHelperApp")) > 0
end tell
}]
return growlrunning
}

If the $growlrunning variable is "true," then Growl is running.

Download macgrowl

The Macnotify Package

The macnotify package is designed to bounce Mac applications on the Dock when the application is not frontmost on the screen and it displays an alert (in the form of a tk_messageBox). The package works via a combination of Tcl and AppleScript. It provides functionality similar to Daniel Steffen's tclCarbonNotification package, but is a script-level package and thus does not require compilation.

Using the Macnotify Package

The macnotify package is called via package require macnotify, and defines the following command:

Download macnotify

The Windowlist Package

The windowlist package implements a "window" menu, which is recommended by Apple's interface guidelines. The package tracks all toplevel windows, minimizes and raises windows, and displays all toplevel windows in an application.

Using the Windowlist Package

The windowlist package is called via package require windowlist, and defines the following command:

Download windowlist


Text ©2010 WordTech Communications, LLC. See Credits for other acknowledgments.

Code by Kevin


A division of WordTech Communications LLC

Products
User Forum
Blog
Open Source
Contact
Sales Policies
Discounts
Credits
About


Latest News


Twitter Updates