本文整理汇总了Python中tkinter.GROOVE属性的典型用法代码示例。如果您正苦于以下问题:Python tkinter.GROOVE属性的具体用法?Python tkinter.GROOVE怎么用?Python tkinter.GROOVE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类tkinter
的用法示例。
在下文中一共展示了tkinter.GROOVE属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def show(self):
self.leave()
self.tip = tk.Toplevel(self.master)
self.tip.withdraw() # Don't show until we have the geometry
self.tip.wm_overrideredirect(True) # No window decorations etc.
if TkUtil.mac():
self.tip.tk.call("::tk::unsupported::MacWindowStyle",
"style", self.tip._w, "help", "none")
label = ttk.Label(self.tip, text=self.text, padding=1,
background=self.background, wraplength=480,
relief=None if TkUtil.mac() else tk.GROOVE,
font=tkfont.nametofont("TkTooltipFont"))
label.pack()
x, y = self.position()
self.tip.wm_geometry("+{}+{}".format(x, y))
self.tip.deiconify()
if self.master.winfo_viewable():
self.tip.transient(self.master)
self.tip.update_idletasks()
self.timerId = self.master.after(self.showTime, self.hide)
示例2: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def __init__(self, master, ticket, **kwargs):
super().__init__(master, **kwargs)
self.editors = []
last_sep = None
generator = (ticket for ticket in (ticket, ticket.addon1, ticket.addon2) if ticket.name)
bt_frame = tk.Frame(self, bd=2, relief=tk.GROOVE, padx=10)
bt_frame.grid(row=1, column=0, columnspan=6, sticky="nswe")
bt_frame.grid_columnconfigure(1, weight=1)
for i, item in enumerate(generator):
if item.options:
self.grid_columnconfigure(i * 2, weight=1)
editor = EditOptionsFrame(self, item)
editor.grid(row=0, column=(i * 2), sticky="nswe")
self.editors.append(editor)
last_sep = ttk.Separator(self, orient=tk.VERTICAL)
last_sep.grid(row=0, column=(i * 2) + 1, sticky="ns")
if last_sep is not None:
last_sep.grid_remove()
done = tk.Button(bt_frame, text="Done", width=8, bg="green", command=self.destroy)
close = tk.Button(bt_frame, text="Close", width=8, bg="red", command=super().destroy) # doesn't save
done.grid(row=0, column=2, pady=10, padx=5, sticky="nse")
close.grid(row=0, column=1, pady=10, padx=5, sticky="nse")
示例3: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def __init__(self, parent, num_of_columns: int, headers: list = None,
**options):
self._parent = parent
super().__init__(self._parent, padding=3, borderwidth=2,
**options)
self.grid()
self.headers = list()
self._rows = list()
self.num_of_columns = num_of_columns
# do some validation
if headers:
if len(headers) != num_of_columns:
raise ValueError
for i, element in enumerate(headers):
label = ttk.Label(self, text=str(element), relief=tk.GROOVE,
padding=self.padding)
label.grid(row=0, column=i, sticky='E,W')
self.headers.append(label)
示例4: add_row
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def add_row(self, data: list):
"""
Add a row of data to the current widget
:param data: a row of data
:return: None
"""
# validation
if self.headers:
if len(self.headers) != len(data):
raise ValueError
if len(data) != self.num_of_columns:
raise ValueError
offset = 0 if not self.headers else 1
row = list()
for i, element in enumerate(data):
label = ttk.Label(self, text=str(element), relief=tk.GROOVE,
padding=self.padding)
label.grid(row=len(self._rows) + offset, column=i, sticky='E,W')
row.append(label)
self._rows.append(row)
示例5: dock
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def dock(self, dock, area):
if not self.__remove_area(dock): # Wasn't already docked
self.xy_for_dock[dock] = (dock.winfo_rootx(),
dock.winfo_rooty())
if not len(self.docked[area]):
area.grid()
self.docked[area].append(dock)
dock.pack_forget()
dock.tk.call("wm", "forget", dock)
options = {"in": area, "padx": 2, "pady": 2, "fill": tk.X}
dock.config(relief=tk.GROOVE, borderwidth=2)
dock.pack(**options)
示例6: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [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 GROOVE [as 别名]
def __init__(self, parent, text, command=None, relief=None, **kwargs):
super().__init__(parent, text=text, **kwargs)
if command is None:
command = self.null_cmd
if relief is None:
relief = tk.RAISED
self.active_config = {"fg":"black", "relief":tk.RAISED}
self.disabled_config = {"fg":"grey26", "relief":tk.GROOVE}
self.command = command
self.configure(bd=2, relief=relief)
self.bind("<Button-1>", self.on_click)
self.bind("<ButtonRelease-1>", self.on_release)
self._active = True
示例8: deactivate
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def deactivate(self):
self.configure(relief=tk.GROOVE, fg="grey26")
self._active = False
示例9: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def __init__(self, master, title):
self.title = title
super().__init__(master, text=title, padding=4)
self.player = None # will be connected later
self.volumeVar = tk.DoubleVar(value=100)
self.volumefilter = VolumeFilter()
ttk.Label(self, text="title / artist / album").pack()
self.titleLabel = ttk.Label(self, relief=tk.GROOVE, width=22, anchor=tk.W)
self.titleLabel.pack()
self.artistLabel = ttk.Label(self, relief=tk.GROOVE, width=22, anchor=tk.W)
self.artistLabel.pack()
self.albumlabel = ttk.Label(self, relief=tk.GROOVE, width=22, anchor=tk.W)
self.albumlabel.pack()
f = ttk.Frame(self)
ttk.Label(f, text="time left: ").pack(side=tk.LEFT)
self.timeleftLabel = ttk.Label(f, relief=tk.GROOVE, anchor=tk.CENTER)
self.timeleftLabel.pack(side=tk.RIGHT, fill=tk.X, expand=True)
f.pack(fill=tk.X)
f = ttk.Frame(self)
ttk.Label(f, text="V: ").pack(side=tk.LEFT)
scale = ttk.Scale(f, from_=0, to=150, length=120, variable=self.volumeVar, command=self.on_volumechange)
scale.bind("<Double-1>", self.on_dblclick_vol)
scale.pack(side=tk.LEFT)
self.volumeLabel = ttk.Label(f, text="???%")
self.volumeLabel.pack(side=tk.RIGHT)
f.pack(fill=tk.X)
ttk.Button(self, text="Skip", command=lambda s=self: s.player.skip(s)).pack(pady=4)
self.volume = 100
self.stateLabel = tk.Label(self, text="STATE", relief=tk.SUNKEN, border=1)
self.stateLabel.pack()
self._track = None
self._time = None
self._stream = None
self._state = self.state_needtrack
self.state = self.state_needtrack
self.xfade_state = self.state_xfade_nofade
self.xfade_started = None
self.xfade_start_volume = None
self.playback_started = None
self.track_duration = None
示例10: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def __init__(self, parent):
self.browser = parent
self.frame = tk.Frame(self.browser.workframe)
self.scansize = ScanLineWidthControl(self)
self.numberofscans = NumberOfScansControl(self)
self.adjust = AdjustControl(self)
self.scanlineplot = ScanlinePlotSliderControl(self)
self.offset = OffsetControl(self)
self.plotbutton = tk.Button(self.frame, text="REPLOT", height=3,
command=self.browser.imager.view_plot_image, relief=tk.GROOVE, borderwidth=4)
self.plotbutton.pack(side=tk.TOP, fill=tk.X, padx=4, pady=4, expand=False)
self.frame.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
示例11: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def __init__(self, master, log_frame):
super().__init__(master, True)
self.log_frame = log_frame
self.configure(border=1, relief=tk.GROOVE)
user_logs_path = os.path.join(THONNY_USER_DIR, "user_logs")
if os.path.exists(user_logs_path):
self.focus_into(user_logs_path)
else:
self.focus_into(os.path.expanduser("~"))
示例12: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def __init__(self,
master,
poser: Poser,
torch_device: torch.device):
super().__init__()
self.master = master
self.poser = poser
self.torch_device = torch_device
self.master.title("Manual Poser")
source_image_frame = Frame(self.master, width=256, height=256)
source_image_frame.pack_propagate(0)
source_image_frame.pack(side=LEFT)
self.source_image_label = Label(source_image_frame, text="Nothing yet!")
self.source_image_label.pack(fill=BOTH, expand=True)
control_frame = Frame(self.master, borderwidth=2, relief=GROOVE)
control_frame.pack(side=LEFT, fill='y')
self.param_sliders = []
for param in self.poser.pose_parameters():
slider = Scale(control_frame,
from_=param.lower_bound,
to=param.upper_bound,
length=256,
resolution=0.001,
orient=HORIZONTAL)
slider.set(param.default_value)
slider.pack(fill='x')
self.param_sliders.append(slider)
label = Label(control_frame, text=param.display_name)
label.pack()
posed_image_frame = Frame(self.master, width=256, height=256)
posed_image_frame.pack_propagate(0)
posed_image_frame.pack(side=LEFT)
self.posed_image_label = Label(posed_image_frame, text="Nothing yet!")
self.posed_image_label.pack(fill=BOTH, expand=True)
self.load_source_image_button = Button(control_frame, text="Load Image ...", relief=GROOVE,
command=self.load_image)
self.load_source_image_button.pack(fill='x')
self.pose_size = len(self.poser.pose_parameters())
self.source_image = None
self.posed_image = None
self.current_pose = None
self.last_pose = None
self.needs_update = False
self.master.after(1000 // 30, self.update_image)
示例13: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import GROOVE [as 别名]
def __init__(self,
master,
poser: Poser,
face_detector,
landmark_locator,
video_capture,
torch_device: torch.device):
self.master = master
self.poser = poser
self.face_detector = face_detector
self.landmark_locator = landmark_locator
self.video_capture = video_capture
self.torch_device = torch_device
self.head_pose_solver = HeadPoseSolver()
self.master.title("Puppeteer")
self.master.protocol("WM_DELETE_WINDOW", self.on_closing)
top_frame = Frame(self.master)
top_frame.pack()
if True:
source_image_frame = Frame(top_frame, width=256, height=256)
source_image_frame.pack_propagate(0)
source_image_frame.pack(side=LEFT)
self.source_image_label = Label(source_image_frame, text="Nothing yet!")
self.source_image_label.pack(fill=BOTH, expand=True)
if True:
control_frame = Frame(top_frame, width=256, height=192)
control_frame.pack_propagate(0)
control_frame.pack(side=LEFT)
self.video_capture_label = Label(control_frame, text="Nothing yet!")
self.video_capture_label.pack(fill=BOTH, expand=True)
if True:
posed_image_frame = Frame(top_frame, width=256, height=256)
posed_image_frame.pack_propagate(0)
posed_image_frame.pack(side=LEFT, fill='y')
self.posed_image_label = Label(posed_image_frame, text="Nothing yet!")
self.posed_image_label.pack(fill=BOTH, expand=True)
bottom_frame = Frame(self.master)
bottom_frame.pack(fill='x')
self.load_source_image_button = Button(bottom_frame, text="Load Image ...", relief=GROOVE,
command=self.load_image)
self.load_source_image_button.pack(fill='x')
self.pose_size = len(self.poser.pose_parameters())
self.source_image = None
self.posed_image = None
self.current_pose = None
self.last_pose = None
self.master.after(1000 // 60, self.update_image())