当前位置: 首页>>代码示例>>Python>>正文


Python Tkinter.S属性代码示例

本文整理汇总了Python中Tkinter.S属性的典型用法代码示例。如果您正苦于以下问题:Python Tkinter.S属性的具体用法?Python Tkinter.S怎么用?Python Tkinter.S使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在Tkinter的用法示例。


在下文中一共展示了Tkinter.S属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __createWidgets

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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
    # -------------------------------------------------------------------------- 
开发者ID:Humpheh,项目名称:PiPark,代码行数:21,代码来源:main.py

示例2: configure_canvas

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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() 
开发者ID:mobiusklein,项目名称:ms_deisotope,代码行数:18,代码来源:view.py

示例3: configure_treeview

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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) 
开发者ID:mobiusklein,项目名称:ms_deisotope,代码行数:24,代码来源:view.py

示例4: __init__

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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) 
开发者ID:felipeochoa,项目名称:minecart,代码行数:21,代码来源:viewer.py

示例5: do_layout

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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) 
开发者ID:mobiusklein,项目名称:ms_deisotope,代码行数:6,代码来源:view.py

示例6: gettime

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
def gettime(ifile):
    from PseudoNetCDF import PseudoNetCDFVariable
    from datetime import datetime, timedelta
    if 'time' in ifile.variables:
        time = ifile.variables['time']
        unit = time.units
        tunit, datestr = unit.split(' since ')
        sdate = datetime.strptime(datestr.replace(
            ' UTC', ''), '%Y-%m-%d %H:%M:%S')
        time = np.array([sdate + timedelta(**{tunit: t}) for t in time[:]])
        unit = 'time'
    elif 'TFLAG' in ifile.variables:
        x = ifile.variables['TFLAG'][:].copy()
        for axi in range(1, x.ndim - 1):
            x = x[:, 0]
        time = np.array(
            [(datetime.strptime('%07d %06d' % (d, t), '%Y%j %H%M%S'))
             for d, t in x])
        unit = 'time'
    elif 'time' in ifile.dimensions:
        time = np.arange(len(ifile.dimensions['time']))
        unit = 'steps'
    elif 'TSTEP' in ifile.dimensions:
        time = np.arange(1, len(ifile.dimensions['TSTEP']) + 1)
        unit = 'steps'
    else:
        raise KeyError('No time found')
    return PseudoNetCDFVariable(None, 'time', 'f', ('time',),
                                values=time[:], units=unit) 
开发者ID:barronh,项目名称:pseudonetcdf,代码行数:31,代码来源:pncview.py

示例7: __run__

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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() 
开发者ID:zooniverse,项目名称:aggregation,代码行数:40,代码来源:marmot.py

示例8: addListBox

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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] 
开发者ID:PCWG,项目名称:PCWG,代码行数:14,代码来源:pcwg_tool_reborn.py

示例9: addListBox

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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] 
开发者ID:PCWG,项目名称:PCWG,代码行数:15,代码来源:base_dialog.py

示例10: master_pane

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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) 
开发者ID:univ-of-utah-marriott-library-apple,项目名称:firmware_password_manager,代码行数:45,代码来源:Skeleton_Key.py

示例11: remote_nav_pane

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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) 
开发者ID:univ-of-utah-marriott-library-apple,项目名称:firmware_password_manager,代码行数:50,代码来源:Skeleton_Key.py

示例12: configure_display_row

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
def configure_display_row(self):
        self.display_row = ttk.Frame(self)
        self.display_row.grid(row=1, column=0, sticky=tk.W + tk.S + tk.E)
        self.cursor_label = ttk.Label(self.display_row, text=" " * 20)
        self.cursor_label.grid(row=0, padx=(10, 10))

        def update_label(*args, **kwargs):
            self.cursor_label['text'] = self.canvas_cursor.binding.get()

        self.canvas_cursor.binding.trace('w', update_label)

        self.ms1_averagine_combobox = ttk.Combobox(self.display_row, values=[
            "peptide",
            "glycan",
            "glycopeptide",
            "heparan sulfate",
        ], width=15)
        self.ms1_averagine_combobox.set("glycopeptide")
        self.ms1_averagine_combobox_label = ttk.Label(self.display_row, text="MS1 Averagine:")
        self.ms1_averagine_combobox_label.grid(row=0, column=1, padx=(10, 0))
        self.ms1_averagine_combobox.grid(row=0, column=2, padx=(1, 10))

        self.msn_averagine_combobox = ttk.Combobox(self.display_row, values=[
            "peptide",
            "glycan",
            "glycopeptide",
            "heparan sulfate",
        ], width=15)
        self.msn_averagine_combobox.set("peptide")
        self.msn_averagine_combobox_label = ttk.Label(self.display_row, text="MSn Averagine:")
        self.msn_averagine_combobox_label.grid(row=0, column=3, padx=(10, 0))
        self.msn_averagine_combobox.grid(row=0, column=4, padx=(1, 10))

        self.ms1_scan_averaging_label = ttk.Label(
            self.display_row, text="MS1 Signal Averaging:")
        self.ms1_scan_averaging_label.grid(row=0, column=5, padx=(10, 0))
        self.ms1_scan_averaging_var = tk.IntVar(self, value=2)
        self.ms1_scan_averaging = ttk.Entry(self.display_row, width=3)
        self.ms1_scan_averaging['textvariable'] = self.ms1_scan_averaging_var
        self.ms1_scan_averaging.grid(row=0, column=6, padx=(1, 3))

        self.min_charge_state_var = tk.IntVar(self, value=1)
        self.max_charge_state_var = tk.IntVar(self, value=12)
        self.min_charge_state_label = ttk.Label(
            self.display_row, text="Min Charge:")
        self.min_charge_state_label.grid(row=0, column=7, padx=(5, 0))
        self.min_charge_state = ttk.Entry(self.display_row, width=3)
        self.min_charge_state['textvariable'] = self.min_charge_state_var
        self.min_charge_state.grid(row=0, column=8, padx=(1, 3))

        self.max_charge_state_label = ttk.Label(
            self.display_row, text="Max Charge:")
        self.max_charge_state_label.grid(row=0, column=9, padx=(5, 0))
        self.max_charge_state = ttk.Entry(self.display_row, width=3)
        self.max_charge_state['textvariable'] = self.max_charge_state_var
        self.max_charge_state.grid(row=0, column=10, padx=(1, 3)) 
开发者ID:mobiusklein,项目名称:ms_deisotope,代码行数:58,代码来源:view.py

示例13: __init__

# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import S [as 别名]
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 
开发者ID:zooniverse,项目名称:aggregation,代码行数:55,代码来源:marmot.py


注:本文中的Tkinter.S属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。