def netcharge(root, amber_prmtop, messages): """ Calculates the net charge and shows its value """ mask = StringVar() cmd_window = Toplevel(root) mask_entry = _guiwidgets.MaskEntry(cmd_window, amber_prmtop, 'Mask from which to calculate charge', 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 action = actions.netCharge(amber_prmtop, ArgumentList(mask.get())) chg = action.execute() showinfo('Net Charge', 'The net charge of [%s] is %.4f' % (mask.get(), chg))
def ok_destroy(self): if not self.variable.get(): showinfo('Missing Variable', "You did not choose an option.") self.destroy()
def info_box(self, event=None): """ Display an info button """ tkMessageBox.showinfo(title=self.action_name, message=str(' '.join( self.desc_string.split())).strip())