On Aug 17, 2007, at 11:45 AM, Pete Siemsen wrote:

> I have a Mac OS X system.  I wrote a Ruby program that uses RubyTk to
> display a TkLabel.  It works, but I'd like a bit more control over how
> it looks.  Here's the code minus the non-Tk stuff that isn't relevant
> to my questions:

<snip>

> 5. Of course, is there a better way to do this?

Now that _has_ has set me straight on how to use the osax library, I  
can suggest another idea:

<code>
#! /usr/bin/env ruby
require "osax"

SEC = 3 # display duration

std_adds = OSAX::osax(nil, "System Events")
std_adds.display_alert("This is a test",
    :message => "This is only a test",
    :giving_up_after => SEC,
    :as => :warning)
</code>

Using OSA scripting additions has two virtues:

1. Much simpler to use than Ruby/Tk (once you know what library to  
require :).
2. As far as I can tell, the alert will always pop-up on top of any  
other window that might be present on the screen.

If all you want to do is pop-up an short message every now and then,  
this may work for you.

Regards, Morton