本文整理汇总了Python中Tkinter.LabelFrame.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python LabelFrame.__init__方法的具体用法?Python LabelFrame.__init__怎么用?Python LabelFrame.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter.LabelFrame
的用法示例。
在下文中一共展示了LabelFrame.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, x):
LabelFrame.__init__(self, x)
# self.default_font = tkFont.nametofont("TkDefaultFont")
# self.default_font.configure(family="Helvetica",size=10)
self.config(relief=GROOVE)
self.config(borderwidth=2)
self.config(text = "Up Time")
self.config(labelanchor = "n")
self.Hsv = StringVar()
self.Hsv.set("")
self.Hlabel = Label(self, textvariable = self.Hsv)
self.Hlabel.grid(row=0, column=0, sticky="wens")
self.Hlabel.config(font=("Courier", 14))
self.Msv = StringVar()
self.Msv.set("")
self.Mlabel = Label(self, textvariable = self.Msv)
self.Mlabel.grid(row=1, column=0, sticky="wens")
self.Mlabel.config(font=("Courier", 14))
self.Ssv = StringVar()
self.Ssv.set("")
self.Slabel = Label(self, textvariable = self.Ssv)
self.Slabel.grid(row=2, column=0, sticky="wens")
self.Slabel.config(font=("Courier", 14))
self.pack()
示例2: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, master, text="Position", **options):
LabelFrame.__init__(self, master, text=text, **options)
self.tracker = master.tracker
self.listbox = Listbox(self)
self.listbox.widget.configure(selectmode=SINGLE)
self.listbox.grid(row=0, column=0, rowspan=6)
self.name_frame = LabelFrame(self, text="Name")
self.name_field = Entry(self.name_frame)
self.name_field.grid()
self.name_frame.grid(row=0, column=1)
self.save_button = Button(self, text="Save current",
command=bg_caller(self.save_position))
self.save_button.grid(row=1, column=1)
self.go_to_button = Button(self, text="Go to",
command=bg_caller(self.go_to_position))
self.go_to_button.grid(row=2, column=1)
self.delete_button = Button(self, text="Delete",
command=self.delete_position)
self.delete_button.grid(row=3, column=1)
self.write_button = Button(self, text="Write to file",
command=self.write_to_file)
self.write_button.grid(row=4, column=1)
self.load_button = Button(self, text="Load from file",
command=self.load_from_file)
self.load_button.grid(row=5, column=1)
示例3: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, x):
LabelFrame.__init__(self, x)
# self.default_font = tkFont.nametofont("TkDefaultFont")
# self.default_font.configure(family="Helvetica",size=12)
self.config(relief=GROOVE)
self.config(borderwidth=2, padx=5, pady=5)
self.config(text = "Encoder")
self.config(labelanchor = "n")
self.INSTRUCTION = StringVar()
self.INSTRUCTION.set("Instruction")
self.machinecode = StringVar()
self.machinecode.set("")
self.codeEntry = Entry(self, textvariable=self.INSTRUCTION)
#self.codeEntry.configure(font=("Helvetica", 12), width=40)
self.codeEntry.configure(width=40)
self.codeButton = Button(self, text="Compile")
self.VHPL = Label(self, text="VHPL")
self.codeButton.grid(row=0, column=0, rowspan=4, sticky="wens")
self.VHPL.grid(row=0, column=1, sticky="wens")
self.VHPL.config(relief=GROOVE, borderwidth=2)
self.codeEntry.grid(row=1, column=1, sticky="wens")
self.codeEntry.config(fg="green", bg="black")
self.pack()
示例4: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, master, tracker, text="Joystick", **options):
LabelFrame.__init__(self, master, text=text, **options)
self.tracker = tracker
self.width = 400
self.height = 400
self.canvas = Canvas(self, height=self.height, width=self.width)
self.canvas.grid()
self.canvas.create_oval((self.width/2 - 3, self.height/2 - 3,
self.width/2 + 3, self.height/2 + 3))
self.canvas.bind("<Button-1>",
bg_caller(lambda event: self.move_tracker(event)))
self.canvas.bind("<Motion>", self.update_label)
self.motion_label = Label(self, text="",
font=tkFont.Font(family="Courier"))
self.motion_label.grid()
f = LabelFrame(self, text="Sensitivity")
self.sensitivity_scale = Scale(f, from_=0, to=10,
resolution=0.01,
orient=HORIZONTAL,
length=self.width)
self.sensitivity_scale.set(5)
self.sensitivity_scale.grid()
f.grid()
示例5: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, root, prtr, settings, log, *arg):
LabelFrame.__init__(self, root, *arg, text="Send gcode")
self.app = root
self.printer = prtr
self.settings = settings
self.log = log
self.entry = Entry(self, width=50)
self.entry.grid(row=1, column=1, columnspan=3, sticky=N+E+W)
self.bSend = Button(self, text="Send", width=4, command=self.doSend, state=DISABLED)
self.bSend.grid(row=1, column=4, padx=2)
self.entry.delete(0, END)
self.entry.bind('<Return>', self.hitEnter)
self.gcv = StringVar(self)
gclist = gcoderef.gcKeys()
self.gcv.set(gclist[0])
l = Label(self, text="G Code Reference:", justify=LEFT)
l.grid(row=2, column=1, columnspan=2, sticky=W)
self.gcm = Combobox(self, textvariable=self.gcv)
self.gcm['values'] = gclist
self.gcm.grid(row=2, column=3, padx=2)
self.gcm.bind('<<ComboboxSelected>>', self.gcodeSel)
示例6: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, root, prtr, settings, log, *arg):
LabelFrame.__init__(self, root, *arg, text="Extruder")
self.app = root
self.printer = prtr
self.settings = settings
self.log = log
self.bExtrude = Button(self, text="Extrude", width=10, command=self.doExtrude)
self.bExtrude.grid(row=1, column=1, padx=2)
self.spDistance = Spinbox(self, from_=1, to=MAXDIST, width=6, justify=RIGHT)
self.spDistance.grid(row=1, column=2)
self.spDistance.delete(0, END)
self.spDistance.insert(0, STARTDIST)
self.spDistance.bind("<FocusOut>", self.valDistance)
self.spDistance.bind("<Leave>", self.valDistance)
l = Label(self, text="mm", justify=LEFT)
l.grid(row=1, column=3, sticky=W)
self.bReverse = Button(self, text="Reverse", width=10, command=self.doReverse)
self.bReverse.grid(row=2, column=1, padx=2)
self.spSpeed = Spinbox(self, from_=1, to=MAXFEED, width=6, justify=RIGHT)
self.spSpeed.grid(row=2, column=2)
self.spSpeed.delete(0, END)
self.spSpeed.insert(0, self.settings.efeed)
self.spSpeed.bind("<FocusOut>", self.valSpeed)
self.spSpeed.bind("<Leave>", self.valSpeed)
l = Label(self, text="mm/min", justify=LEFT)
l.grid(row=2, column=3, sticky=W)
示例7: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, root, *arg):
LabelFrame.__init__(self, root, *arg, text="Log")
self.log = Text(self, width=60, height=24, state=DISABLED, wrap=WORD, takefocus="0")
self.log.grid(row=1, column=1, sticky=N+E+W+S)
self.sblog = Scrollbar(self, command=self.log.yview, orient="vertical")
self.sblog.grid(column=2, row=1, sticky=N+S+E)
self.log.config(yscrollcommand=self.sblog.set)
示例8: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, **kwargs):
master = None if 'master' not in kwargs else kwargs['master']
LabelFrame.__init__(self, master, text='Wheel')
self.unitopts = ['%s (%s)' % (x.name, x.symbol)
for x in WheelEntry.DIA_UNITS]
self.__val = WheelEntry.DIA_UNITS[0]
self.createSpin()
self.create_unit_opts()
示例9: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, x):
LabelFrame.__init__(self, x)
# self.default_font = tkFont.nametofont("TkDefaultFont")
# self.default_font.configure(family="Helvetica",size=10)
self.config(relief=GROOVE)
self.config(borderwidth=2)
self.config(text="Decoder")
self.mkButtons()
示例10: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, **kwargs):
master = None if 'master' not in kwargs else kwargs['master']
LabelFrame.__init__(self, master, text='Output Options')
self.config(padx=20, pady=5)
self.cadences = CadenceEntry()
self.cadences.grid(row=0, column=0, sticky=W, in_=self)
self.velocity = VelocitySelect()
self.velocity.grid(row=1, column=0, sticky=W, in_=self)
示例11: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, parent, **kwargs):
"""!
The constructor for the class
@param self The pointer for the object
@param parent The parent object for the frame
@param **kwargs Other arguments as accepted by Tkinter.Frame
"""
LabelFrame.__init__(self, parent, **kwargs)
self.configure(background=DEFAULT_BACKGROUND)
示例12: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, master, names, parsers={}, **kwargs):
LabelFrame.__init__(self, master, **kwargs)
entries = {}
for name in names:
f = LabelFrame(self, text=name)
entries[name] = Entry(f)
entries[name].grid()
f.grid()
NamedEntryContainer.__init__(self, entries=entries, parsers=parsers)
示例13: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, **kwargs):
master = None if 'master' not in kwargs else kwargs['master']
title = None if 'title' not in kwargs else kwargs['title']
rings = [] if 'rings' not in kwargs else kwargs['rings']
LabelFrame.__init__(self, master, text=title)
self.config(padx=20, pady=5)
self.rings = []
self.addbut = Button(text='+', command=self.userAddRing)
for ring in rings:
self.addRing(ring)
self.renderRings()
示例14: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self,parent,container,show,active=False,*args,**kwargs):
LabelFrame.__init__(self,parent,*args,**kwargs)
# self.items = container.__dict__[show]
self.active = active
self.parent = parent
self.frames = []
self.show = show
self.container = container
self.analyzeData()
self.initUIElements()
self.gridUIElements()
示例15: __init__
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import __init__ [as 别名]
def __init__(self, x):
LabelFrame.__init__(self, x)
# self.default_font = tkFont.nametofont("TkDefaultFont")
# self.default_font.configure(family="Helvetica",size=12)
self.config(relief=GROOVE)
self.config(borderwidth=2, padx=5, pady=5)
self.config(text = "Information")
self.config(labelanchor = "n")
self.readmeButton = Button(self, text="README", fg="red")
self.readmeButton.grid(row=0, column=0, sticky="wens")
self.pack()