self.master.config(menu=menubar) def onExit(self): ''' Called on closing ColdControl. Confirms the exit and safely closes the various UI's. ''' exitConfirmation = tkMessageBox.askquestion("Please confirm exit",\ "Are you sure you want to close Cold Control?\nThis will release all DAQ cards and exit the program - unsaved information will be lost?", icon='warning') if exitConfirmation == 'yes': print 'Closing camera connections...' self.camera_UI.closeCameras() print '...all camera connections closed.' print 'Releasing DAQ cards...' if not self.development_mode: self.daq_UI.daq_controller.releaseAll() print '...all cards released.' print 'Saving labbook...' self.labbook_UI.write() print '...labbook saved' root.destroy() print 'Cold Control closed - bye!' if __name__ == "__main__": root = tk.Tk() root.geometry("1600x800") Styles.configureStyles() ColdControl_UI(root).pack(fill="both", expand=True) root.mainloop()