Exemple #1
0
def printdetails(root, amber_prmtop, messages):
   """ Prints details about a given Amber mask """
   title = 'Print Details'
   mask = StringVar()
   cmd_window = Toplevel(root)
   cmd_window.title(title)
   mask_entry = _guiwidgets.MaskEntry(cmd_window, amber_prmtop,
                     'Input an Amber Mask', mask, cmd_window)
   mask_entry.config(pady=10)
   mask_entry.grid(row=0, column=0, sticky=N+E+S+W)
   button = Button(cmd_window, text='OK / Quit', command=cmd_window.destroy)
   button.grid(row=1, column=0, sticky=N+E+S+W)
   cmd_window.wait_window()
   if not mask.get(): return
   # Print our mask
   window = Toplevel(root)
   window.resizable(True, True)
   window.title('Atom information for mask %s' % mask.get())
   text = _guiwidgets.ExitingScrollText(window, None, spacing3=5, padx=5,
                                        pady=5, width=100, height=20)
   text.pack(fill=BOTH, expand=1)
   action = ParmedActions.printdetails(amber_prmtop, mask.get())
   text.write(action)
   messages.write('Printed Amber Mask details on [%s]\n' % mask.get())
   window.wait_window()