From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Nov 10 2009 - 16:33:36 CST

Nuno,
  Have a look at the Tk plugin examples I've provided here:
http://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/tcltkplugins.html#tcltkplugins

You don't actually want to destroy your plugin's window, you only want to
iconify it. There are a few exceptions to this (e.g. multiplot) but in most
cases, you just want the plugin window hidden, and you don't want to destroy
it and all of the callbacks etc that may have been registered.

Let us know if you have more questions.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Nov 10, 2009 at 10:55:24AM +0000, Nuno Sousa Cerqueira wrote:
> Hello,
> I made a Gui for vmd.
> The Gui is started with this :
> if {[winfo exists $VsLab::topGui]} {wm deiconify $VsLab::topGui ;return}
> toplevel $VsLab::topGui
> (...)
> I have a exit button in the Gui that does the following command:
> grid [ttk::button $VsLab::topGui.f2.exit -text "Exit" -command {destroy
> $VsLab::topGui}] -in $VsLab::topGui.f2 -padx 20 -pady 5 -sticky e
> However, when I click the exit button and go again to the menu where the
> shortcut of the extension is installed I can not longer load the Gui.
> I can only do it if I go to the tkconsole and write the proc that
> initializes the Gui.
> If I close the window with the X button (in the top corner of the window)
> I can can do it....
> does anyone had a similar problem....
> Regards , nuno

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078