本文整理汇总了Python中Tkinter.SUNKEN属性的典型用法代码示例。如果您正苦于以下问题:Python Tkinter.SUNKEN属性的具体用法?Python Tkinter.SUNKEN怎么用?Python Tkinter.SUNKEN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类Tkinter
的用法示例。
在下文中一共展示了Tkinter.SUNKEN属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import SUNKEN [as 别名]
def __init__(self, master, width=500, height=350,
canvwidth=600, canvheight=500):
TK.Frame.__init__(self, master, width=width, height=height)
self._rootwindow = self.winfo_toplevel()
self.width, self.height = width, height
self.canvwidth, self.canvheight = canvwidth, canvheight
self.bg = "white"
self._canvas = TK.Canvas(master, width=width, height=height,
bg=self.bg, relief=TK.SUNKEN, borderwidth=2)
self.hscroll = TK.Scrollbar(master, command=self._canvas.xview,
orient=TK.HORIZONTAL)
self.vscroll = TK.Scrollbar(master, command=self._canvas.yview)
self._canvas.configure(xscrollcommand=self.hscroll.set,
yscrollcommand=self.vscroll.set)
self.rowconfigure(0, weight=1, minsize=0)
self.columnconfigure(0, weight=1, minsize=0)
self._canvas.grid(padx=1, in_ = self, pady=1, row=0,
column=0, rowspan=1, columnspan=1, sticky='news')
self.vscroll.grid(padx=1, in_ = self, pady=1, row=0,
column=1, rowspan=1, columnspan=1, sticky='news')
self.hscroll.grid(padx=1, in_ = self, pady=1, row=1,
column=0, rowspan=1, columnspan=1, sticky='news')
self.reset()
self._rootwindow.bind('<Configure>', self.onResize)
示例2: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import SUNKEN [as 别名]
def __init__(self, parent):
# Store reference object for creating child dialogs.
self.parent = parent
self.win_lens1 = None
self.win_lens2 = None
self.win_align = None
self.work_done = False
self.work_error = None
self.work_status = None
# Create dummy lens configuration.
self.lens1 = FisheyeLens()
self.lens2 = FisheyeLens()
self.lens2.center_qq = [0,0,1,0] # Default flip along Y axis.
# Create frame for this GUI.
parent.wm_title('Panorama Creation Tool')
frame = tk.Frame(parent)
# Make file-selection inputs for the two images.
img_frame = tk.LabelFrame(frame, text='Input Images')
self.img1 = self._make_file_select(img_frame, 0, 'Image #1')
self.img2 = self._make_file_select(img_frame, 1, 'Image #2')
img_frame.pack()
# Make buttons to load, save, and adjust the lens configuration.
lens_frame = tk.LabelFrame(frame, text='Lens Configuration and Alignment')
btn_lens1 = tk.Button(lens_frame, text='Lens 1', command=self._adjust_lens1)
btn_lens2 = tk.Button(lens_frame, text='Lens 2', command=self._adjust_lens2)
btn_align = tk.Button(lens_frame, text='Align', command=self._adjust_align)
btn_auto = tk.Button(lens_frame, text='Auto', command=self._auto_align_start)
btn_load = tk.Button(lens_frame, text='Load', command=self.load_config)
btn_save = tk.Button(lens_frame, text='Save', command=self.save_config)
btn_lens1.grid(row=0, column=0, sticky='NESW')
btn_lens2.grid(row=0, column=1, sticky='NESW')
btn_align.grid(row=0, column=2, sticky='NESW')
btn_auto.grid(row=0, column=3, sticky='NESW')
btn_load.grid(row=1, column=0, columnspan=2, sticky='NESW')
btn_save.grid(row=1, column=2, columnspan=2, sticky='NESW')
lens_frame.pack(fill=tk.BOTH)
# Buttons to render the final output in different modes.
out_frame = tk.LabelFrame(frame, text='Final output rendering')
btn_rect = tk.Button(out_frame, text='Equirectangular',
command=self._render_rect)
btn_cube = tk.Button(out_frame, text='Cubemap',
command=self._render_cube)
btn_rect.pack(fill=tk.BOTH)
btn_cube.pack(fill=tk.BOTH)
out_frame.pack(fill=tk.BOTH)
# Status indicator box.
self.status = tk.Label(frame, relief=tk.SUNKEN,
text='Select input images to begin.')
self.status.pack(fill=tk.BOTH)
# Finish frame creation.
frame.pack()
# Helper function to destroy an object.
示例3: put_sprite
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import SUNKEN [as 别名]
def put_sprite(num):
global SPRITES, BTNS
SPRITES[num] = 1 - SPRITES[num] # not actual value
if SPRITES[num]:
BTNS[num].config(relief=SUNKEN)
else:
BTNS[num].config(relief=RAISED)
# Draws sprite over a image
# It uses the alpha chanel to see which pixels need to be reeplaced
# Input: image, sprite: numpy arrays
# output: resulting merged image