本文整理汇总了Python中tkinter.RIDGE属性的典型用法代码示例。如果您正苦于以下问题:Python tkinter.RIDGE属性的具体用法?Python tkinter.RIDGE怎么用?Python tkinter.RIDGE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类tkinter
的用法示例。
在下文中一共展示了tkinter.RIDGE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_gui
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def _init_gui(self):
self.window = tk.Tk()
self.window.geometry('800x400')
self.window.title('Launcher')
frame_top = tk.Frame(bd=1, relief=tk.RIDGE)
frame_bottom = tk.Frame(bd=1, relief=tk.RIDGE)
self.dropdown = ttk.Combobox(frame_top, values=glob.glob('*.yaml'))
self.dropdown.current(0)
self.button_start = tk.Button(frame_top, text='Start', fg='green')
self.button_stop = tk.Button(frame_top, text='Stop', fg='red', state=tk.DISABLED)
self.output = scrolledtext.ScrolledText(frame_bottom)
frame_top.pack(fill=tk.BOTH, padx=5, pady=5)
frame_bottom.pack(fill=tk.BOTH, expand=True, padx=5, pady=5)
self.dropdown.pack(padx=5, pady=5, fill=tk.X, side=tk.LEFT)
self.button_start.pack(padx=5, pady=5, side=tk.LEFT)
self.button_stop.pack(padx=5, pady=5, side=tk.LEFT)
self.output.pack(fill=tk.BOTH, expand=True)
self.button_start.bind('<Button-1>', self._on_start)
self.button_stop.bind('<Button-1>', self._on_stop)
self.window.protocol('WM_DELETE_WINDOW', self._on_closing)
示例2: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def __init__(self, controller, master=None, main=None, title='Title', right_label_text=None, allow_remove=True, number=1, **kwargs):
'''
controller: a mentalist.controller.Controller instance
master: the tkinter master of this view
main: a mentalist.view.Main instance
title: the title string to be displayed for this node
right_label_text: an optional string to be displayed on the right-hand
side (word count)
allow_remove: False if attempting to remove this node gives an error message
number: an integer starting with 1 identifying this node's position in the chain
'''
Frame.__init__(self, master=master, **kwargs)
self.controller = controller
self.title = title
self.main = main
self.attrs = []
self.number = number
self.allow_remove = allow_remove
self.configure(borderwidth=1, relief=Tk.RAISED)
self.upper_frame = Frame(self)
self.upper_frame.configure(borderwidth=1, relief=Tk.RIDGE)
self.lb_title = Tk.Label(self.upper_frame, text='{}. {}'.format(number, title))
self.lb_title.pack(fill="both", side="left", padx=10, pady=10)
if right_label_text is not None: # this is the right-justified word count label
self.right_label = Tk.Label(self.upper_frame, text=right_label_text, font=('Helvetica', '10', 'italic'))
self.right_label.pack(fill="both", side="right", padx=10, pady=10)
else:
self.right_label = None
self.upper_frame.pack(side="top", fill="x", expand=1)
self.lower_frame = Frame(self)
self.lower_frame.pack(side="bottom", fill="both")
self.add_upper_button()
if self.allow_remove:
self.add_remove_button()
self.pack(side="top", fill="both", padx=2, pady=2)
示例3: _Spacer
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def _Spacer(self):
# Buttons are 30px high. Make this 26px tall +2px padding to center it.
s = tk.Frame(
master=self, height=26, relief=tk.RIDGE, pady=2, bg="DarkGray")
s.pack(side=tk.LEFT, padx=5)
return s
示例4: _Spacer
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def _Spacer(self):
# Buttons are 30px high, so make this 26px tall with padding to center it
s = Tk.Frame(
master=self, height=26, relief=Tk.RIDGE, pady=2, bg="DarkGray")
s.pack(side=Tk.LEFT, padx=5)
return s
示例5: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def __init__(self, parent, **kwargs):
super().__init__(parent, **kwargs)
self.grid_columnconfigure(0, weight=1)
self.network_status = NetworkStatus(self, relief=tk.RIDGE, bd=2, font=self.font, bg="grey16")
self.network_status.grid(row=0, column=0, sticky="w", pady=5, padx=2)
self.clock = lib.Clock(self, font=self.font)
self.print_toggle = lib.ToggleSwitch(self, "print", font=self.font, state=lib.AsyncTk().forward("print"))
self.print_toggle.grid(row=0, column=1, sticky="w", padx=5)
self.clock.grid(row=0, column=2, sticky="w", padx=5)
示例6: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def __init__(self, master, ncol, **kwargs):
super().__init__(master, bd=3, bg="grey16", **kwargs)
for i in range(ncol):
self.grid_columnconfigure(i, weight=1)
self.grid_rowconfigure(0, weight=1)
self.widgets = [ItemInfo(self, relief=tk.GROOVE, bd=2) for i in range(ncol)]
self.ncol = ncol
for i, widget in enumerate(self.widgets):
widget.grid(row=0, column=i, sticky="nswe")
self.ticket_no = tk.Label(self, bg="grey16", fg="white", relief=tk.RIDGE, font=("Courier", 20))
self.ticket_no.grid(row=0, column=0, sticky="sw")
self.data = None
示例7: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def __init__(self, parent, **kwargs):
super().__init__(parent, **kwargs)
self.grid_columnconfigure(0, weight=1)
self.network_status = NetworkStatus(self, relief=tk.RIDGE, bd=2, font=self.font)
self.network_status.grid(row=0, column=0, sticky="w", pady=5, padx=2)
self.clock = lib.Clock(self, font=self.font)
self.clock.grid(row=0, column=1, sticky="w", padx=5)
示例8: update
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def update(self, ticket):
order_queue = lib.AsyncTk().forward("order_queue")
name = order_queue[str(ticket.ticket_no)]["name"]
deliver = order_queue[str(ticket.ticket_no)]["deliver"]
if not ticket:
return self.reset()
self.ticket = ticket
self["relief"] = tk.RIDGE
self.ticket_no["relief"] = tk.RAISED
text = "{:03d}".format(ticket.ticket_no)
if name:
text += f": {name}"
self.ticket_no["text"] = text
self.item_info.update(ticket)
self.addon1_info.update(ticket.addon1)
self.addon2_info.update(ticket.addon2)
if deliver:
self.deliver.grid()
self.deliver.lift()
self["bg"] = "red"
self.ticket_no["bg"] = "red"
else:
self.deliver.grid_remove()
self["bg"] = "white smoke"
self.ticket_no["bg"] = "white smoke"
示例9: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def __init__(self, parent, **kwargs):
super().__init__(parent,
width=11,
state=tk.DISABLED,
disabledbackground="white",
disabledforeground="black",
relief=tk.RIDGE, **kwargs)
self._time = tk.StringVar(self)
self["textvariable"] = self._time
示例10: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def __init__(self, parent, **kwargs):
super().__init__(parent, **kwargs)
self.grid_columnconfigure(0, weight=1)
self.grid_columnconfigure(1, weight=0)
self.grid_columnconfigure(2, weight=1)
self.network_status = NetworkStatus(self, relief=tk.RIDGE, bd=2)
self.network_status.grid(row=0, column=0, sticky="w")
self.clock = lib.Clock(self, font=self.font)
self.clock.grid(row=0, column=1, sticky="we")
self.shutdown_button = ShutdownButton(self, bg="red")
self.shutdown_button.grid(row=0, column=2, sticky="e")
示例11: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def __init__(self, parent, **kwargs):
super().__init__(parent, **kwargs)
self.widgets = WidgetCache(TicketEditor, self, initial_size=4)
tk.Label(self, width=3, font=ItemEditor.font).grid(row=0, column=0, sticky="nswe", padx=2, ipadx=2)
self.calculator_frame = tk.Frame(self, bd=2, relief=tk.RIDGE)
self.calculator = EditorCalculator(self.calculator_frame)
self._difference = tk.StringVar(self)
self.difference_label = tk.Label(self.calculator_frame, text="Difference ", font=ItemEditor.font)
self.difference_entry = tk.Entry(self.calculator_frame,
textvariable=self._difference,
font=ItemEditor.font,
state=tk.DISABLED,
disabledforeground="black",
disabledbackground="white",
width=10)
self.difference_label.grid(row=0, column=0, sticky="w")
self.difference_entry.grid(row=0, column=1, sticky="w")
self.calculator.grid(row=1, column=0, sticky="w", columnspan=2)
self.calculator_frame.grid(row=0, column=1, sticky="nswe", columnspan=2, pady=2, padx=2)
self.ticket_no = None
self.orderprogress = None
self.is_gridded = False
self.original_total = None
示例12: main
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def main(protocol):
logger = logging.getLogger("main.POS")
logger.setLevel(logging.INFO)
main = AsyncTk(protocol())
main.geometry("1280x800")
main.grid_columnconfigure(2, weight=2)
main.grid_rowconfigure(1, weight=1)
main.resizable(False, False)
if not DEBUG:
main.attributes("-fullscreen", True)
title_bar = POS.TitleBar(main, bd=2)
menu_display = POS.MenuDisplay(main, relief=tk.RIDGE, bd=2)
order_display = POS.OrderDisplay(main, bd=2, relief=tk.RIDGE)
editor = POS.MenuEditor(main, bd=2, relief=tk.RIDGE)
console = POS.Console(main, bd=2, relief=tk.RIDGE)
price_display = POS.PriceDisplay(main, relief=tk.RIDGE, bd=2)
title_bar.grid(row=0, column=0, columnspan=3, sticky="nswe", padx=2, pady=2)
menu_display.grid(row=1, column=0, columnspan=2, sticky="nswe", padx=2, pady=2)
editor.grid(row=1, column=0, columnspan=2, sticky="nswe", padx=2, pady=2)
menu_display.lift()
order_display.grid(row=1, column=2, pady=2, padx=2, sticky="nswe")
console.grid(row=2, column=0, columnspan=2, pady=5, sticky="nswe")
price_display.grid(row=2, column=2)
# add methods to tkinter's update loop
order_display.update()
editor.update()
price_display.update()
title_bar.update()
# add shutdown task
protocol.shutdown(main.delegate, cleanup=AsyncTk().destroy)
main.mainloop()
示例13: add_frame_separator
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def add_frame_separator(self):
""" Add a separator between top and bottom frames """
logger.debug("Add frame seperator")
sep = ttk.Frame(self.page_frame, height=2, relief=tk.RIDGE)
sep.pack(fill=tk.X, pady=(5, 0), side=tk.BOTTOM)
logger.debug("Added frame seperator")
示例14: add_frame_separator
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def add_frame_separator(self):
""" Add a separator between top and bottom frames """
logger.debug("Adding frame seperator")
sep = ttk.Frame(self, height=2, relief=tk.RIDGE)
sep.pack(fill=tk.X, pady=(5, 0), side=tk.BOTTOM)
示例15: layout_frames
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import RIDGE [as 别名]
def layout_frames(self):
""" Top level container frames """
logger.debug("Layout frames")
leftframe = ttk.Frame(self)
leftframe.pack(side=tk.LEFT, expand=False, fill=tk.BOTH, pady=5)
sep = ttk.Frame(self, width=2, relief=tk.RIDGE)
sep.pack(fill=tk.Y, side=tk.LEFT)
self.graph_frame = ttk.Frame(self)
self.graph_frame.pack(side=tk.RIGHT, fill=tk.BOTH, pady=5, expand=True)
logger.debug("Laid out frames")
return leftframe