def __init__(self, parent, onClose, depth, onChangeSearchDepth): Toplevel.__init__(self, parent) self.transient(parent) self.title('Rebuild Search') self.onClose = onClose self.onChangeSearchDepth = onChangeSearchDepth # Position the dialog box relative to parent. xpos = int(geoparse.get_x(parent.geometry())) + 100 ypos = int(geoparse.get_y(parent.geometry())) + 100 self.geometry('+' + str(xpos) + '+' + str(ypos)) Label(self).grid(row=1) Label(self, text='This will rebuild the search table.').grid(row=5) Label(self).grid(row=7) Label(self, text='A large search depth may').grid(row=9) Label(self, text='take a long time.').grid(row=10) Label(self).grid(row=13) self.depthCounter = Pmw.Counter(self, labelpos='w', label_text='Search depth:', entryfield_value=depth, entryfield_validate={ 'validator': 'integer', 'min': 1, 'max': 4 }, entry_width=2, entry_bg='white') self.depthCounter.grid(row=15) Label(self).grid(row=17) Label(self, text='Click OK to proceed.').grid(row=20) box = Pmw.ButtonBox(self) box.add('OK', command=self.onOK) box.add('Cancel', command=self.close) box.setdefault('OK') box.alignbuttons() box.grid(row=25) # Override DELETE_WINDOW handler to a local callback. self.protocol('WM_DELETE_WINDOW', self.close)
def __init__(self, parent, onClose, depth, onChangeSearchDepth): Toplevel.__init__(self, parent) self.transient(parent) self.title("Rebuild Search") self.onClose = onClose self.onChangeSearchDepth = onChangeSearchDepth # Position the dialog box relative to parent. xpos = int(geoparse.get_x(parent.geometry())) + 100 ypos = int(geoparse.get_y(parent.geometry())) + 100 self.geometry("+" + str(xpos) + "+" + str(ypos)) Label(self).grid(row=1) Label(self, text="This will rebuild the search table.").grid(row=5) Label(self).grid(row=7) Label(self, text="A large search depth may").grid(row=9) Label(self, text="take a long time.").grid(row=10) Label(self).grid(row=13) self.depthCounter = Pmw.Counter( self, labelpos="w", label_text="Search depth:", entryfield_value=depth, entryfield_validate={"validator": "integer", "min": 1, "max": 4}, entry_width=2, entry_bg="white", ) self.depthCounter.grid(row=15) Label(self).grid(row=17) Label(self, text="Click OK to proceed.").grid(row=20) box = Pmw.ButtonBox(self) box.add("OK", command=self.onOK) box.add("Cancel", command=self.close) box.setdefault("OK") box.alignbuttons() box.grid(row=25) # Override DELETE_WINDOW handler to a local callback. self.protocol("WM_DELETE_WINDOW", self.close)
def __init__(self, parent, on_close): Toplevel.__init__(self, parent) self.transient(parent) self.title('About CDAT Help') self.on_close = on_close # Position the dialog box relative to parent. xpos = int(geoparse.get_x(parent.geometry())) + 100 ypos = int(geoparse.get_y(parent.geometry())) + 100 self.geometry('+' + str(xpos) + '+' + str(ypos)) p, c = gui_support.buildDate() text = """Climate Data Analysis Tools (CDAT) Help\n\n""" text += """Python built on: %s\n""" % p text += """CDAT built on: %s\n\n""" % c text += """Copyright 2001-2008, Regents of the University of California All rights reserved.\n\n This release of CDAT Help incorporates modules from other organizations besides LLNL some of which are distributed under open source licenses of their choosing, and therefore may be subject to different terms and conditions. We ask that users respect these terms and conditions as well as any copyright notices requirements.\n """ text += """Go to http://cdat.sourceforge.net for documentation, support, bug reporting, and releases. Program for Climate Model Diagnosis and Intercomparison Lawrence Livermore National Laboratory Livermore, CA 94550 """ label = Label(self, text=text).grid(row=2) # Create close button. button = Button(self, text='Close', command=self.close).grid(row=10) # Override DELETE_WINDOW handler to a local callback. self.protocol('WM_DELETE_WINDOW', self.close)
def __init__(self, parent, on_close): Toplevel.__init__(self, parent) self.transient(parent) self.title("About CDAT Help") self.on_close = on_close # Position the dialog box relative to parent. xpos = int(geoparse.get_x(parent.geometry())) + 100 ypos = int(geoparse.get_y(parent.geometry())) + 100 self.geometry("+" + str(xpos) + "+" + str(ypos)) p, c = gui_support.buildDate() text = """Climate Data Analysis Tools (CDAT) Help\n\n""" text += """Python built on: %s\n""" % p text += """CDAT built on: %s\n\n""" % c text += """Copyright 2001-2008, Regents of the University of California All rights reserved.\n\n This release of CDAT Help incorporates modules from other organizations besides LLNL some of which are distributed under open source licenses of their choosing, and therefore may be subject to different terms and conditions. We ask that users respect these terms and conditions as well as any copyright notices requirements.\n """ text += """Go to http://cdat.sourceforge.net for documentation, support, bug reporting, and releases. Program for Climate Model Diagnosis and Intercomparison Lawrence Livermore National Laboratory Livermore, CA 94550 """ label = Label(self, text=text).grid(row=2) # Create close button. button = Button(self, text="Close", command=self.close).grid(row=10) # Override DELETE_WINDOW handler to a local callback. self.protocol("WM_DELETE_WINDOW", self.close)
def __init__(self, parent, on_close): Toplevel.__init__(self, parent) self.transient(parent) self.title('About CDAT Demo') self.on_close = on_close # Position the dialog box relative to parent. xpos = int(geoparse.get_x(parent.geometry())) + 100 ypos = int(geoparse.get_y(parent.geometry())) + 100 self.geometry('+' + str(xpos) + '+' + str(ypos)) # Create background image. fname = os.path.join(sys.exec_prefix, 'bin/images', 'about.gif') self.photo = PhotoImage(file=fname) imageLabel = Label(self, bd=0, image=self.photo) imageLabel.grid(rowspan=15) # Create URL link. self.linkLabel = Label(self, bd=0, bg='white', fg='blue', cursor='hand2', text='http://www-pcmdi.llnl.gov/cdat') self.linkLabel.grid(row=11) self.linkLabel.bind('<ButtonRelease-1>', self.onLeftClick) self.linkLabel.bind('<Enter>', self.onEnter) self.linkLabel.bind('<Leave>', self.onLeave) # Create close button. closeButton = Button(self, text='Close', command=self.close) closeButton.grid(row=14) # Override DELETE_WINDOW handler to a local callback. self.protocol('WM_DELETE_WINDOW', self.close)
def __init__ (self, parent, on_close): Toplevel.__init__ (self, parent) self.transient(parent) self.title ('About CDAT Demo') self.on_close = on_close # Position the dialog box relative to parent. xpos = int(geoparse.get_x (parent.geometry())) + 100 ypos = int(geoparse.get_y (parent.geometry())) + 100 self.geometry ('+' + str(xpos) + '+' + str(ypos)) # Create background image. fname = os.path.join (sys.exec_prefix, 'bin/images', 'about.gif') self.photo = PhotoImage (file = fname) imageLabel = Label (self, bd = 0, image=self.photo) imageLabel.grid(rowspan = 15) # Create URL link. self.linkLabel = Label (self, bd = 0, bg = 'white', fg = 'blue', cursor = 'hand2', text = 'http://www-pcmdi.llnl.gov/cdat') self.linkLabel.grid (row=11) self.linkLabel.bind ('<ButtonRelease-1>', self.onLeftClick) self.linkLabel.bind ('<Enter>', self.onEnter) self.linkLabel.bind ('<Leave>', self.onLeave) # Create close button. closeButton = Button (self, text='Close', command=self.close) closeButton.grid(row=14) # Override DELETE_WINDOW handler to a local callback. self.protocol ('WM_DELETE_WINDOW', self.close)
def __setPosition(self): '''Position the dialog box relative to parent.''' self.transient(self.__parent) xpos = int(geoparse.get_x(self.__parent.geometry())) + 100 ypos = int(geoparse.get_y(self.__parent.geometry())) + 100 self.geometry('+' + str(xpos) + '+' + str(ypos))