Minimizing a Tk window

Hello: I am using Ruby 1.8.6 with Tk and have an application that I
start and park in the system tray to use with files opened in the SciTE
editor. I select text in the SciTE editor and then copy it, then I bring
up the Tk application and paste the selected text and process it. My
question is, how can I minimize my Tk window application back down to
the system tray and have the SciTE editor still display the selected
text? I want the Tk application doing the minimize, not the user
clicking on the minimize icon.

I can partially do this using .iconify, however the SciTE window seems
to lack focus as my selected text is no longer highlighted. I want this
to act the same way as if you clicked on the minimize icon which does
seem to give focus back to the SciTE file as you can see the selected

Thanks for any help.