Python Tkinter.N Examples

The following are 24 code examples of Tkinter.N(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module Tkinter , or try the search function .
Example #1
Source File: dataset.py    From PCWG with MIT License 6 votes vote down vote up
def add_rews(self, master):
                    
        self.addTitleRow(master, "REWS Settings:")
        self.rewsDefined = self.addCheckBox(master, "REWS Active", self.config.rewsDefined)
        self.numberOfRotorLevels = self.addEntry(master, "REWS Number of Rotor Levels:", validation.ValidateNonNegativeInteger(master), self.config.numberOfRotorLevels)
        self.rotorMode = self.addOption(master, "REWS Rotor Mode:", ["EvenlySpacedLevels", "ProfileLevels"], self.config.rotorMode)
        self.hubMode = self.addOption(master, "Hub Mode:", ["Interpolated", "PiecewiseExponent"], self.config.hubMode)                

        label = tk.Label(master, text="REWS Profile Levels:")
        label.grid(row=self.row, sticky=tk.W, column=self.titleColumn, columnspan = 2)
        self.row += 1
        
        self.rewsGridBox = REWSGridBox(master, self, self.row, self.inputColumn)
        self.rewsGridBox.add_items(self.config.rewsProfileLevels)

        self.copyToShearButton = tk.Button(master, text="Copy To Shear", command = self.copyToShearREWSProfileLevels, width=12, height=1)
        self.copyToShearButton.grid(row=self.row, sticky=tk.E+tk.N, column=self.buttonColumn) 
Example #2
Source File: dataset.py    From PCWG with MIT License 6 votes vote down vote up
def add_measurements(self, master):

        self.timeStepInSeconds = self.addEntry(master, "Time Step In Seconds:", validation.ValidatePositiveInteger(master), self.config.timeStepInSeconds)
        self.badData = self.addEntry(master, "Bad Data Value:", validation.ValidateFloat(master), self.config.badData)

        self.dateFormat = self.addEntry(master, "Date Format:", validation.ValidateNotBlank(master), self.config.dateFormat, width = 60)
        pickDateFormatButton = tk.Button(master, text=".", command = base_dialog.DateFormatPicker(self, self.dateFormat, ['%Y-%m-%d %H:%M:%S', '%Y-%m-%dT%H:%M:%S', '%d-%m-%y %H:%M', '%y-%m-%d %H:%M', '%d/%m/%Y %H:%M', '%d/%m/%Y %H:%M:%S', '%d/%m/%y %H:%M', '%y/%m/%d %H:%M']), width=5, height=1)
        pickDateFormatButton.grid(row=(self.row-1), sticky=tk.E+tk.N, column=self.buttonColumn)              

        self.timeStamp = self.addPickerEntry(master, "Time Stamp:", validation.ValidateNotBlank(master), self.config.timeStamp, width = 60) 
        self.turbineLocationWindSpeed = self.addPickerEntry(master, "Turbine Location Wind Speed:", None, self.config.turbineLocationWindSpeed, width = 60) #Should this be with reference wind speed?
        self.hubWindSpeed = self.addPickerEntry(master, "Hub Wind Speed:", None, self.config.hubWindSpeed, width = 60)
        self.hubTurbulence = self.addPickerEntry(master, "Hub Turbulence:", None, self.config.hubTurbulence, width = 60)
        self.temperature = self.addPickerEntry(master, "Temperature:", None, self.config.temperature, width = 60)
        self.pressure = self.addPickerEntry(master, "Pressure:", None, self.config.pressure, width = 60)
        self.density = self.addPickerEntry(master, "Density:", None, self.config.density, width = 60)
        self.inflowAngle = self.addPickerEntry(master, "Inflow Angle:", None, self.config.inflowAngle, width = 60)
        self.inflowAngle.setTip('Not required') 
Example #3
Source File: view.py    From ms_deisotope with Apache License 2.0 6 votes vote down vote up
def configure_canvas(self):
        self.figure = Figure(dpi=100)
        self.canvas = FigureCanvasTkAgg(self.figure, master=self)
        self.axis = self.figure.add_subplot(111)
        self.canvas.draw()
        canvas_widget = self.canvas.get_tk_widget()
        canvas_widget.grid(row=0, column=0, sticky=tk.N + tk.W + tk.E + tk.S)
        self.canvas_cursor = Cursor(self.axis, tk.StringVar(master=self.root))
        self.canvas.mpl_connect('motion_notify_event', self.canvas_cursor.mouse_move)
        self.span = SpanSelector(
            self.axis, self.zoom, 'horizontal', useblit=True,
            rectprops=dict(alpha=0.5, facecolor='red'))
        self.mz_span = None
        self.scan = None
        self.annotations = []
        self.canvas.draw() 
Example #4
Source File: view.py    From ms_deisotope with Apache License 2.0 6 votes vote down vote up
def configure_treeview(self):
        self.treeview = ttk.Treeview(self)
        self.treeview['columns'] = ["id", "time", 'ms_level', 'precursor_mz', 'precursor_charge', 'activation']
        self.treeview.grid(row=2, column=0, sticky=tk.S + tk.W + tk.E + tk.N)

        self.treeview_scrollbar = ttk.Scrollbar(self, orient="vertical", command=self.treeview.yview)
        self.treeview_scrollbar.grid(row=2, column=0, sticky=tk.S + tk.E + tk.N)
        self.treeview.configure(yscrollcommand=self.treeview_scrollbar.set)

        self.treeview.heading('id', text="Scan ID")
        self.treeview.heading('#0', text='Index')
        self.treeview.heading("time", text='Time (min)')
        self.treeview.heading("ms_level", text='MS Level')
        self.treeview.heading("precursor_mz", text='Precursor M/Z')
        self.treeview.heading("precursor_charge", text='Precursor Z')
        self.treeview.heading("activation", text='Activation')
        self.treeview.column("#0", width=75)
        self.treeview.column("ms_level", width=75)
        self.treeview.column("time", width=75)
        self.treeview.column("precursor_mz", width=100)
        self.treeview.column("precursor_charge", width=100)
        self.treeview.bind("<<TreeviewSelect>>", self.on_row_click) 
Example #5
Source File: Frame_2D_GUI_metric.py    From Structural-Engineering with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def license_display(self, *event):
        # Function to display license dialog on app start
        license_string = ("Copyright (c) 2019, Donald N. Bockoven III\n"
                            "All rights reserved.\n\n"
                            "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""
                            " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"
                            " IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"
                            " DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE"
                            " FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"
                            " DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"
                            " SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"
                            " CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,"
                            " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE"
                            " OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
                            "https://github.com/buddyd16/Structural-Engineering/blob/master/LICENSE"
                            )

        tkMessageBox.showerror("License Information",license_string)
        self.master.focus_force() 
Example #6
Source File: Frame_2D_GUI.py    From Structural-Engineering with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def license_display(self, *event):
        # Function to display license dialog on app start
        license_string = ("Copyright (c) 2019, Donald N. Bockoven III\n"
                            "All rights reserved.\n\n"
                            "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""
                            " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"
                            " IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"
                            " DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE"
                            " FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"
                            " DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"
                            " SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"
                            " CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,"
                            " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE"
                            " OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
                            "https://github.com/buddyd16/Structural-Engineering/blob/master/LICENSE"
                            )

        tkMessageBox.showerror("License Information",license_string)
        self.master.focus_force() 
Example #7
Source File: grid_box.py    From PCWG with MIT License 6 votes vote down vote up
def _set_up_tree_widget(self):

        tree_container = ttk.Frame(self.container)

        tree_container.grid(row=0, column=0, sticky=tk.W+tk.E+tk.N+tk.S)

        #tree_container.pack(fill='both', expand=True)

        # create a treeview with dual scrollbars
        self.tree = ttk.Treeview(tree_container, columns=self.headers, show="headings")
        
        vsb = ttk.Scrollbar(tree_container, orient="vertical", command=self.tree.yview)
        hsb = ttk.Scrollbar(tree_container, orient="horizontal", command=self.tree.xview)

        self.tree.configure(yscrollcommand=vsb.set, xscrollcommand=hsb.set)
        self.tree.grid(column=0, row=0, sticky='nsew')

        vsb.grid(column=1, row=0, sticky='ns')
        hsb.grid(column=0, row=1, sticky='ew')

        tree_container.grid_columnconfigure(0, weight=1)
        tree_container.grid_rowconfigure(0, weight=1)

        self.tree.bind("<Double-1>", self.double_click) 
Example #8
Source File: viewer.py    From minecart with MIT License 6 votes vote down vote up
def __init__(self, master=None, cnf=None, **kwargs):
        self.frame = ttk.Frame(master)
        self.frame.grid_rowconfigure(0, weight=1)
        self.frame.grid_columnconfigure(0, weight=1)
        self.xbar = AutoScrollbar(self.frame, orient=tkinter.HORIZONTAL)
        self.xbar.grid(row=1, column=0,
                       sticky=tkinter.E + tkinter.W)
        self.ybar = AutoScrollbar(self.frame)
        self.ybar.grid(row=0, column=1,
                       sticky=tkinter.S + tkinter.N)
        tkinter.Canvas.__init__(self, self.frame, cnf or {},
                                xscrollcommand=self.xbar.set,
                                yscrollcommand=self.ybar.set,
                                **kwargs)
        tkinter.Canvas.grid(self, row=0, column=0,
                            sticky=tkinter.E + tkinter.W + tkinter.N + tkinter.S)
        self.xbar.config(command=self.xview)
        self.ybar.config(command=self.yview)
        self.bind("<MouseWheel>", self.on_mousewheel) 
Example #9
Source File: pcwg_tool_reborn.py    From PCWG with MIT License 6 votes vote down vote up
def addDatePickerEntry(self, master, title, validation, value, width = None):

        if value != None:
            if type(value) == str:
                textValue = value
            else:
                textValue = value.strftime(datePickerFormat)
        else:
            textValue = None
      
        entry = self.addEntry(master, title + " " + datePickerFormatDisplay, validation, textValue, width = width)
        entry.entry.config(state=tk.DISABLED)
        
        pickButton = tk.Button(master, text=".", command = DatePicker(self, entry, datePickerFormat), width=3, height=1)
        pickButton.grid(row=(self.row-1), sticky=tk.N, column=self.inputColumn, padx = 160)

        clearButton = tk.Button(master, text="x", command = ClearEntry(entry), width=3, height=1)
        clearButton.grid(row=(self.row-1), sticky=tk.W, column=self.inputColumn, padx = 133)
                
        entry.bindPickButton(pickButton)

        return entry 
Example #10
Source File: main.py    From PiPark with GNU General Public License v2.0 6 votes vote down vote up
def __createWidgets(self):
        """Create the widgets. """
        if self.__is_verbose: print "INFO: Creating Widgets!"
        
        # create show preview button
        self.preview_button = tk.Button(self, text = "Show Camera Feed",
            command = self.clickStartPreview)
        self.preview_button.grid(row = 1, column = 0, 
            sticky = tk.W + tk.E + tk.N + tk.S)
        
        # create quit button
        self.quit_button = tk.Button(self, text = "Quit",
            command = self.clickQuit)
        self.quit_button.grid(row = 1, column = 1, 
            sticky = tk.W + tk.E + tk.N + tk.S)
    
    # --------------------------------------------------------------------------
    #   Load Image
    # -------------------------------------------------------------------------- 
Example #11
Source File: base_dialog.py    From PCWG with MIT License 6 votes vote down vote up
def addDatePickerEntry(self, master, title, validation, value, width = None):

        if value != None:
            if type(value) == str:
                textValue = value
            else:
                textValue = value.strftime(datePickerFormat)
        else:
            textValue = None
                
        entry = self.addEntry(master, title + " " + datePickerFormatDisplay, validation, textValue, width = width)
        entry.entry.config(state=tk.DISABLED)
        
        pickButton = tk.Button(master, text="...", command = DatePicker(self, entry, datePickerFormat), width=3, height=1)
        pickButton.grid(row=(self.row-1), sticky=tk.N, column=self.inputColumn, padx = 160)
                
        entry.bindPickButton(pickButton)

        return entry 
Example #12
Source File: pcwg_tool_reborn.py    From PCWG with MIT License 5 votes vote down vote up
def addPickerEntry(self, master, title, validation, value, width = None):

            entry = self.addEntry(master, title, validation, value, width = width)
            pickButton = tk.Button(master, text=".", command = ColumnPicker(self, entry), width=5, height=1)
            pickButton.grid(row=(self.row-1), sticky=tk.E+tk.N, column=self.buttonColumn)
                    
            entry.bindPickButton(pickButton)

            return entry 
Example #13
Source File: dataset.py    From PCWG with MIT License 5 votes vote down vote up
def add_reference_shear(self, master):
        
        self.shearCalibrationMethod = self.addOption(master, "Shear Calibration Method:", ["None", "LeastSquares"], self.config.shearCalibrationMethod)
        self.row += 1   

        label = tk.Label(master, text="Reference Shear Heights (Power Law):")
        label.grid(row=self.row, sticky=tk.W, column=self.titleColumn, columnspan = 2)
        self.row += 1   
       
        self.referenceShearGridBox = ShearGridBox(master, self, self.row, self.inputColumn)
        self.referenceShearGridBox.add_items(self.config.referenceShearMeasurements)

        self.copyToREWSButton = tk.Button(master, text="Copy To REWS", command = self.copyToREWSShearProfileLevels, width=12, height=1)
        self.copyToREWSButton.grid(row=self.row, sticky=tk.E+tk.N, column=self.buttonColumn) 
Example #14
Source File: analysis.py    From PCWG with MIT License 5 votes vote down vote up
def add_turbine(self, master):
        
        self.specifiedPowerCurve = self.addFileOpenEntry(master, "Specified Power Curve:", validation.ValidateSpecifiedPowerCurve(master, self.powerCurveMode), self.config.specified_power_curve.absolute_path, self.filePath)

        self.addPowerCurveButton = tk.Button(master, text="New", command = self.NewPowerCurve, width=5, height=1)
        self.addPowerCurveButton.grid(row=(self.row-2), sticky=tk.E+tk.N, column=self.secondButtonColumn)
        
        self.editPowerCurveButton = tk.Button(master, text="Edit", command = self.EditPowerCurve, width=5, height=1)
        self.editPowerCurveButton.grid(row=(self.row-1), sticky=tk.E+tk.S, column=self.secondButtonColumn) 
Example #15
Source File: grid_box.py    From PCWG with MIT License 5 votes vote down vote up
def __init__(self, master, headers, row, column):

        self.master = master
        self.headers = headers

        self.items_dict = {}

        self.tree = None

        self.container = ttk.Frame(self.master)
        self.container.grid(row=row, column=column, sticky=tk.W+tk.E+tk.N+tk.S)

        self._set_up_tree_widget()
        self._build_tree()

        # create a popup menu
        self.pop_menu = tk.Menu(self.tree, tearoff=0)

        self.pop_menu.add_command(label="New", command=self.new)
        self.pop_menu.add_command(label="Remove", command=self.remove)
        self.pop_menu.add_command(label="Remove All", command=self.remove_all)
        self.pop_menu.add_command(label="Edit", command=self.edit)

        self.pop_menu_add = tk.Menu(self.tree, tearoff=0)
        self.pop_menu_add.add_command(label="New", command=self.new)
        self.pop_menu_add.add_command(label="Remove All", command=self.remove_all)

        self.tree.bind("<Button-2>", self.pop_up)
        self.tree.bind("<Button-3>", self.pop_up)
        
        self.onChange = EventHook()

        self.tip = None 
Example #16
Source File: base_dialog.py    From PCWG with MIT License 5 votes vote down vote up
def addListBox(self, master, title, height = 3):
            
        scrollbar =  tk.Scrollbar(master, orient=tk.VERTICAL)
        tipLabel = tk.Label(master, text="")
        tipLabel.grid(row = self.row, sticky=tk.W, column=self.tipColumn)                
        lb = tk.Listbox(master, yscrollcommand=scrollbar, selectmode=tk.EXTENDED, height=height)  
        
        self.listboxEntries[title] = ListBoxEntry(lb,scrollbar,tipLabel)
        self.row += 1

        self.listboxEntries[title].scrollbar.configure(command=self.listboxEntries[title].listbox.yview)
        self.listboxEntries[title].scrollbar.grid(row=self.row, sticky=tk.W+tk.N+tk.S, column=self.titleColumn)
        return self.listboxEntries[title] 
Example #17
Source File: pcwg_tool_reborn.py    From PCWG with MIT License 5 votes vote down vote up
def addListBox(self, master, title):
            
            scrollbar =  tk.Scrollbar(master, orient=tk.VERTICAL)
            tipLabel = tk.Label(master, text="")
            tipLabel.grid(row = self.row, sticky=tk.W, column=self.tipColumn)                
            lb = tk.Listbox(master, yscrollcommand=scrollbar, selectmode=tk.EXTENDED, height=3)  
            
            self.listboxEntries[title] = ListBoxEntry(lb,scrollbar,tipLabel)              
            self.row += 1
            self.listboxEntries[title].scrollbar.configure(command=self.listboxEntries[title].listbox.yview)
            self.listboxEntries[title].scrollbar.grid(row=self.row, sticky=tk.W+tk.N+tk.S, column=self.titleColumn)
            return self.listboxEntries[title] 
Example #18
Source File: marmot.py    From aggregation with Apache License 2.0 5 votes vote down vote up
def __run__(self):
        # create the welcome window
        run_type = None
        t = tkinter.Toplevel(self.root)
        t.resizable(False,False)
        frame = ttk.Frame(t, padding="3 3 12 12")
        frame.grid(column=0, row=0, sticky=(tkinter.N, tkinter.W, tkinter.E, tkinter.S))
        frame.columnconfigure(0, weight=1)
        frame.rowconfigure(0, weight=1)
        ttk.Label(frame,text="Welcome to Marmot.").grid(column=1,row=1)
        def setup(require_gold_standard):
            # this will determine the whole run mode from here on in
            self.require_gold_standard = require_gold_standard
            self.subjects = self.__image_select__(require_gold_standard)
            # if r == "a":
            #     self.subjects = self.project.__get_retired_subjects__(1,True)
            #     self.run_mode = "a"
            # else:
            #     # when we want to explore subjects which don't have gold standard
            #     # basically creating some as we go
            #     # False => read in all subjects, not just those with gold standard annotations
            #     # todo - takes a while in read in all subjects. Better way?
            #     self.subjects = self.project.__get_retired_subjects__(1,False)
            #     self.run_mode = "b"
            random.shuffle(self.subjects)

            self.__thumbnail_display__()
            self.__add_buttons__()

            t.destroy()

        ttk.Button(frame, text="Explore results using existing expert annotations", command = lambda : setup(True)).grid(column=1, row=2)
        ttk.Button(frame, text="Explore and create gold standard on the fly", command = lambda : setup(False)).grid(column=1, row=3)

        t.lift(self.root)

        # self.outputButtons()
        self.root.mainloop() 
Example #19
Source File: view.py    From ms_deisotope with Apache License 2.0 5 votes vote down vote up
def do_layout(self):
        self.grid(sticky=tk.N + tk.W + tk.E + tk.S)
        tk.Grid.rowconfigure(self, 0, weight=1)
        tk.Grid.columnconfigure(self, 0, weight=1) 
Example #20
Source File: tk_simple_dialog.py    From PCWG with MIT License 4 votes vote down vote up
def __init__(self, parent, title = None):

        tk.Toplevel.__init__(self, parent)
        self.transient(parent)

        if title:
            self.title(title)

        self.parent = parent

        self.result = None

        body = tk.Frame(self)
        self.initial_focus = self.body(body)
        #body.pack(padx=5, pady=5)

        box = tk.Frame(self)
        self.buttonbox(box)

        body.grid(row=0, column=0, sticky=tk.W+tk.E+tk.N+tk.S)
        box.grid(row=1, column=0, sticky=tk.W+tk.E+tk.N+tk.S)

        self.grid_columnconfigure(0, weight=1)
        self.grid_rowconfigure(0, weight=1)
        self.grid_rowconfigure(1, weight=0)

        self.grab_set()

        if not self.initial_focus:
            self.initial_focus = self

        self.protocol("WM_DELETE_WINDOW", self.cancel)

        self.geometry("+%d+%d" % (parent.winfo_rootx()+50,
                                  parent.winfo_rooty()+50))

        self.initial_focus.focus_set()

        self.wait_window(self)

        if not hasattr(self, 'is_ok'):
            self.is_ok = False

    #
    # construction hooks 
Example #21
Source File: marmot.py    From aggregation with Apache License 2.0 4 votes vote down vote up
def __init__(self):
        self.project = Penguins()
        # self.project.__migrate__()

        # tkinter stuff
        self.root = tkinter.Tk()
        self.root.geometry('900x700')
        self.root.title("Marmot")
        self.root.resizable(False,False)

        # ttk stuff - congrads if you understand the difference between tkinter and ttk
        self.mainframe = ttk.Frame(self.root, padding="3 3 12 12")
        self.mainframe.grid(column=0, row=0, sticky=(tkinter.N, tkinter.W, tkinter.E, tkinter.S))
        self.mainframe.columnconfigure(0, weight=1)
        self.mainframe.rowconfigure(0, weight=1)

        self.root.option_add('*tearOff', False)

        self.links = []

        self.true_probabilities = {}
        self.false_probabilities = {}

        self.percentage_thresholds = {}
        self.probability_threshold = {}
        self.weightings = {}

        # might have to truly random - but this way, we don't always download new images
        random.seed(1)
        # store all of the subjects in a random order
        self.subjects = []
        # self.subjects = self.project.__get_retired_subjects__(1,True)
        #
        # random.shuffle(self.subjects)
        self.page_index = 0
        self.step_size = 45


        # see for deleting previous thumbnails when we go to a new page
        self.thumbnails = []

        self.true_positives = {}
        self.false_positives = {}
        self.unknown_positives = {}

        self.run_mode = None

        # used that we can store values when we go back to an image
        self.matplotlib_points = {}
        self.probabilities = {}

        # by default no
        self.require_gold_standard = False 
Example #22
Source File: analysis.py    From PCWG with MIT License 4 votes vote down vote up
def addFormElements(self, master, path):            

        nb = ttk.Notebook(master, height=400)
        nb.pressed_index = None
        
        general_tab = tk.Frame(nb)
        power_curve_tab = tk.Frame(nb)
        datasets_tab = tk.Frame(nb)
        inner_range_tab = tk.Frame(nb)
        density_tab = tk.Frame(nb)
        turbine_tab = tk.Frame(nb)
        rews_tab = tk.Frame(nb)
        corrections_tab = tk.Frame(nb)
        output_pdm_tab = tk.Frame(nb)
        advanced_tab = tk.Frame(nb)
        #alternative_corrections_tab = tk.Frame(nb)

        nb.add(general_tab, text='General', padding=3)
        nb.add(power_curve_tab, text='Power Curve', padding=3)
        nb.add(datasets_tab, text='Datasets', padding=3)
        nb.add(turbine_tab, text='Turbine', padding=3)
        nb.add(density_tab, text='Density', padding=3)
        nb.add(rews_tab, text='REWS', padding=3)
        nb.add(corrections_tab, text='Corrections', padding=3)
        nb.add(inner_range_tab, text='Inner Range', padding=3)
        nb.add(output_pdm_tab, text='Output PDM', padding=3)
        nb.add(advanced_tab, text='Advanced', padding=3)
        #nb.add(alternative_corrections_tab, text='Alternative Corrections', padding=3)

        nb.grid(row=self.row, sticky=tk.E+tk.W+tk.N+tk.S, column=self.titleColumn, columnspan=8)
        master.grid_rowconfigure(self.row, weight=1)
        self.row += 1
        
        self.add_general(general_tab, path)
        self.add_power_curve(power_curve_tab)
        self.add_datasets(datasets_tab)
        self.add_inner_range(inner_range_tab)
        self.add_density(density_tab)
        self.add_turbine(turbine_tab)
        self.add_rews(rews_tab)
        self.add_corrections(corrections_tab)     
        self.add_output_pdm(output_pdm_tab)                                                                                                            
        self.add_advanced(advanced_tab)
        #self.add_alternative_corrections(alternative_corrections_tab) 
Example #23
Source File: Skeleton_Key.py    From firmware_password_manager with MIT License 4 votes vote down vote up
def remote_nav_pane(self):
        """
        Connect to server and select keyfile.
        """
        self.logger.info("%s: activated" % inspect.stack()[0][3])
        self.mainframe.grid_remove()

        try:
            if self.config_options["keyfile"]["remote_type"] == 'smb':
                if self.config_options["keyfile"]["server_path"]:
                    self.remote_hostname.set(self.config_options["keyfile"]["server_path"])

                if self.config_options["keyfile"]["username"]:
                    self.remote_username.set(self.config_options["keyfile"]["username"])

                if self.config_options["keyfile"]["password"]:
                    self.remote_password.set(self.config_options["keyfile"]["password"])
        except:
            pass

        self.remote_nav_frame = ttk.Frame(self.superframe, width=604, height=510)
        self.remote_nav_frame.grid(column=0, row=2, sticky=(N, W, E, S))

        self.remote_nav_frame.grid_columnconfigure(0, weight=1)
        self.remote_nav_frame.grid_columnconfigure(1, weight=1)
        self.remote_nav_frame.grid_columnconfigure(2, weight=1)
        self.remote_nav_frame.grid_columnconfigure(3, weight=1)

        ttk.Label(self.remote_nav_frame, text="Read keyfile from remote server: (ie smb://...)").grid(column=0, row=100, columnspan=4, sticky=(E, W))

        ttk.Label(self.remote_nav_frame, text="Server path:").grid(column=0, row=150, sticky=E)
        hname_entry = ttk.Entry(self.remote_nav_frame, width=30, textvariable=self.remote_hostname)
        hname_entry.grid(column=1, row=150, sticky=W, columnspan=2)

        ttk.Label(self.remote_nav_frame, text="Username:").grid(column=0, row=200, sticky=E)
        uname_entry = ttk.Entry(self.remote_nav_frame, width=30, textvariable=self.remote_username)
        uname_entry.grid(column=1, row=200, sticky=W, columnspan=2)

        ttk.Label(self.remote_nav_frame, text="Password:").grid(column=0, row=250, sticky=E)
        pword_entry = ttk.Entry(self.remote_nav_frame, width=30, textvariable=self.remote_password, show="*")
        pword_entry.grid(column=1, row=250, sticky=W, columnspan=2)

        ttk.Button(self.remote_nav_frame, text="Read keyfile", width=15, default='active', command=self.read_remote).grid(column=1, row=300, columnspan=2, pady=12)

        ttk.Separator(self.remote_nav_frame, orient=HORIZONTAL).grid(row=1000, columnspan=50, pady=12, sticky=(E, W))

        ttk.Button(self.remote_nav_frame, text="Return to home", command=self.master_pane).grid(column=2, row=1100, sticky=E)
        ttk.Button(self.remote_nav_frame, text="Quit", width=6, command=self.root.destroy).grid(column=3, row=1100, sticky=W) 
Example #24
Source File: Skeleton_Key.py    From firmware_password_manager with MIT License 4 votes vote down vote up
def master_pane(self):
        """
        The home pane.
        """
        self.logger.info("%s: activated" % inspect.stack()[0][3])
        self.logger.info("%s" % inspect.stack()[1][3])

        self.mainframe = ttk.Frame(self.superframe, width=604, height=510)
        self.mainframe.grid(column=0, row=2, sticky=(N, W, E, S))

        self.mainframe.grid_rowconfigure(0, weight=1)
        self.mainframe.grid_rowconfigure(5, weight=1)
        self.mainframe.grid_columnconfigure(0, weight=1)
        self.mainframe.grid_columnconfigure(2, weight=1)

        self.change_state_btn = ttk.Button(self.mainframe, width=20, text="Change State", command=self.change_state)
        self.change_state_btn.grid(column=0, row=80, pady=4, columnspan=3)
        self.change_state_btn.configure(state=self.state_button_state)

        self.info_status_label = ttk.Label(self.mainframe, text='Location of keyfile:')
        self.info_status_label.grid(column=0, row=90, pady=8, columnspan=3)

        ttk.Button(self.mainframe, width=20, text="Retrieve from JSS Script", command=self.jss_pane).grid(column=0, row=100, pady=4, columnspan=3)

        ttk.Button(self.mainframe, width=20, text="Fetch from Remote Volume", command=self.remote_nav_pane).grid(column=0, row=200, pady=4, columnspan=3)
        ttk.Button(self.mainframe, width=20, text="Retrieve from Local Volume", command=self.local_nav_pane).grid(column=0, row=300, pady=4, columnspan=3)
        ttk.Button(self.mainframe, width=20, text="Enter Firmware Password", command=self.direct_entry_pane).grid(column=0, row=320, pady=4, columnspan=3)

        ttk.Separator(self.mainframe, orient=HORIZONTAL).grid(row=400, columnspan=3, sticky=(E, W), pady=8)

        hash_display = ttk.Entry(self.mainframe, width=58, textvariable=self.hashed_results)
        hash_display.grid(column=0, row=450, columnspan=4)

        self.hash_btn = ttk.Button(self.mainframe, width=20, text="Copy hash to clipboard", command=self.copy_hash)
        self.hash_btn.grid(column=0, row=500, pady=4, columnspan=3)
        self.hash_btn.configure(state=self.hash_button_state)

        ttk.Separator(self.mainframe, orient=HORIZONTAL).grid(row=700, columnspan=3, sticky=(E, W), pady=8)

        self.status_label = ttk.Label(self.mainframe, textvariable=self.status_string)
        self.status_label.grid(column=0, row=2100, sticky=W, columnspan=2)

        ttk.Button(self.mainframe, text="Quit", width=6, command=self.root.destroy).grid(column=2, row=2100, sticky=E)