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


Python LabelFrame.config方法代码示例

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


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

示例1: initUI

# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import config [as 别名]
    def initUI(self):

        self.parent.title("IAF CALC 0.01")
        self.pack(fill=BOTH, expand=1)

        self.configure(background="white")

        frameTOP = Frame(self)
        frameTOP.config(bg="white")
        frameTOP.pack(side=TOP)

        frameFILES = Frame(frameTOP)
        frameFILES.pack(side=LEFT, padx=10)

        # --- BUTTON FOR FILE 1 --- #
        frameF1 = LabelFrame(frameFILES, text="Eyes open file:", relief=FLAT, borderwidth=1, background="white")
        frameF1.pack(fill=X, expand=1)
        self.nameF1 = Entry(frameF1, width=50)
        self.nameF1.config(bg="lightgray")
        self.nameF1.pack(side=LEFT)
        self.nameF1.delete(0, END)
        self.nameF1.insert(0, "")
        self.buttonLoadFile1 = Button(frameF1, text="...", command=self.askOpenFile1)
        self.buttonLoadFile1.pack(side=LEFT, padx=5, pady=5)
        # ----------------------- #

        # --- BUTTON FOR FILE 2 --- #
        frameF2 = LabelFrame(frameFILES, text="Eyes closed file:", relief=FLAT, borderwidth=1, background="white")
        frameF2.pack(fill=X, expand=1)
        self.nameF2 = Entry(frameF2, width=50)
        self.nameF2.config(bg="lightgray")
        self.nameF2.pack(side=LEFT)
        self.nameF2.delete(0, END)
        self.nameF2.insert(0, "")
        self.buttonLoadFile2 = Button(frameF2, text="...", command=self.askOpenFile2)
        self.buttonLoadFile2.pack(side=LEFT, padx=5, pady=5)
        # ----------------------- #

        # --- BUTTON FOR FILE OUTPUT --- #
        frameO = LabelFrame(frameFILES, text="Output directory:", relief=FLAT, borderwidth=1, background="white")
        frameO.pack(fill=X, expand=1)
        self.nameO = Entry(frameO, width=50)
        self.nameO.config(bg="lightgray")
        self.nameO.pack(side=LEFT)
        self.nameO.delete(0, END)
        self.nameO.insert(0, "")
        self.buttonSelectOutput = Button(frameO, text="...", command=self.askOutputDirectory)
        self.buttonSelectOutput.pack(side=LEFT, padx=5, pady=5)
        # -------------------------------#
        # self.pack()
        # self.pack(fill=Y, expand=1)

        # ---------- PSD PARAMETER SELECTION ---------- #
        framePARAM = Frame(frameTOP)
        framePARAM.config(bg="white")
        framePARAM.pack(side=LEFT, fill=X)

        frame = LabelFrame(framePARAM, text="PSD Parameters", relief=RIDGE, borderwidth=1, background="white")
        frame.pack(fill=BOTH, expand=1, side=TOP)

        wFs = Label(frame, text="Fs:", bg="white")
        wFs.pack(side=LEFT)
        self.inputFs = Entry(frame, width=5)
        self.inputFs.pack(side=LEFT, padx=5)
        self.inputFs.delete(0, END)
        self.inputFs.insert(0, "500")

        wWS = Label(frame, text="Window size:", bg="white")
        wWS.pack(side=LEFT)
        self.inputWinSize = Entry(frame, width=5)
        self.inputWinSize.pack(side=LEFT, padx=5)
        self.inputWinSize.delete(0, END)
        self.inputWinSize.insert(0, "1024")

        wOL = Label(frame, text="Overlap:", bg="white")
        wOL.pack(side=LEFT)
        self.inputOverlap = Entry(frame, width=5)
        self.inputOverlap.pack(side=LEFT, padx=5)
        self.inputOverlap.delete(0, END)
        self.inputOverlap.insert(0, "512")

        wWT = Label(frame, text="Window function:", bg="white")
        wWT.pack(side=LEFT)

        variable = StringVar(frame)
        variable.set("Hamming")  # default value
        self.inputWinType = OptionMenu(frame, variable, "Hamming", "Bartlett", "Blackman", "Hanning", "None")
        self.inputWinType.config(bg="white", width=10)
        self.inputWinType.pack(side=LEFT)

        buttonRun = Button(frame, text="GO!", command=self.goTime)
        buttonRun.pack(side=RIGHT)

        # Channel selector
        frameCh = LabelFrame(framePARAM, text="Channels", relief=RIDGE, borderwidth=1, background="white")
        frameCh.pack(fill=BOTH, expand=1, side=TOP)

        self.EOch1 = IntVar()
        self.inputEOch1 = Checkbutton(frameCh, text="1", variable=self.EOch1, bg="white")
        self.inputEOch1.pack(side=LEFT)
#.........这里部分代码省略.........
开发者ID:silmis,项目名称:CENTplatform,代码行数:103,代码来源:iafcalc.py

示例2: view

# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import config [as 别名]
class view(Tk):
    
    def mkStringVar(self, s):
        R = StringVar()
        R.set(s)
        return R
    
    def mkLabel(self, f, T, r, c, rs=1, cs=1):
        if isinstance(T, type(StringVar())):
            R = Label(f, textvariable = T, relief=GROOVE, borderwidth=2)
        else:
            R = Label(f, text = T, relief=GROOVE, borderwidth=2)
        R.grid(row=r, column=c, rowspan=rs, columnspan=cs, sticky="wens")
        return R

    def mkLabelList(self, f, SV, r):
        R = []
        for i in range(len(SV)):
            R.append(self.mkLabel(f, SV[i], r, i+1))
        return R

    def mkButton(self, f, t, r, c, rs=1, cs=1):
        R = Button(f, text=t)
        R.grid( row=r, column=c, rowspan=rs, columnspan=cs, sticky="wens")
        return R

# ===== HALT et cetera =========================================================

    def mkHaltArea(self, f):
        self.HALTframe = Frame(f)
        self.HALTframe.config(relief=GROOVE)
        self.HALTframe.config(borderwidth=2)

        self.HALTbutton = Button(self.HALTframe, text = "HALT", width=10)
        self.READMEbutton = Button(self.HALTframe, text = "README", width=10)

        self.HALTbutton.config(borderwidth=2, relief=GROOVE, fg="red")
        self.HALTbutton.config(command = self.quit)
        self.READMEbutton.config(borderwidth=2, relief=GROOVE, fg="red")

        self.HALTbutton.pack(side=LEFT, fill=BOTH)
        self.READMEbutton.pack(side=RIGHT, fill=BOTH)

        self.HALTframe.grid(row=0, column=9, rowspan=1, columnspan=4, sticky="wens")

# ==============================================================================

    def mkProgramControl(self, f):        
        self.PROGRAMCONTROLframe = Frame(f)
        self.PROGRAMCONTROLframe.config(relief=GROOVE)
        self.PROGRAMCONTROLframe.config(borderwidth=2)

        self.runButton = Button(self.PROGRAMCONTROLframe, text="RUN", width=10)
        self.runButton.grid(row=0, column=0, sticky="wens", padx=29, pady=7)

        self.stepButton = Button(self.PROGRAMCONTROLframe, text="STEP", width=10)
        self.stepButton.grid(row=1, column=0, sticky="wens", padx=29, pady=5)

        self.noStepButton = Button(self.PROGRAMCONTROLframe, text="NOSTEP", width=10)
        self.noStepButton.grid(row=2, column=0, sticky="wens", padx=29, pady=7)

        self.PROGRAMCONTROLframe.grid(row=17, column=11, rowspan=6, columnspan=2, sticky="wens")

# ==============================================================================

    def getPGMfileName(self):
        options = {'filetypes': [('pgm files', '.pgm')]}
        f = askopenfilename(**options)
        g = f.split('/')
        self.filenameVar.set(g[len(g) - 1])
        return f

    def mkProgramLoad(self, f):
        self.PROGRAMLOADframe = Frame(f)
        self.PROGRAMLOADframe.config(relief=GROOVE)
        self.PROGRAMLOADframe.config(borderwidth=2)

        self.loadPGMbutton = Button(self.PROGRAMLOADframe, text="Load PGM")
        self.loadPGMbutton.config(width=14)
        self.loadPGMbutton.pack(side=LEFT, fill=BOTH, padx=20, pady=5)
        
        self.filenameVar = StringVar()
        self.filenameVar.set("*****.pgm")
        
        self.fileNameLabel = Label(self.PROGRAMLOADframe, textvariable=self.filenameVar)
        self.fileNameLabel.config(relief=GROOVE, borderwidth=2, width=17)
        self.fileNameLabel.pack(side=RIGHT, fill=BOTH, padx=20, pady=5)

        self.PROGRAMLOADframe.grid(row=15, column=9, rowspan=2, columnspan=4, sticky="wens")

# ==============================================================================

    def mkMemory(self, f):
        self.MEMORYframe = Frame(f)
        self.MEMORYframe.config(relief=GROOVE)
        self.MEMORYframe.config(borderwidth=2)

        E = Frame(self.MEMORYframe)

        self.CLEAR = self.mkButton(E, "ClearMem", 0, 0)
#.........这里部分代码省略.........
开发者ID:andrew-blais,项目名称:VirtualMachine,代码行数:103,代码来源:view.py


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