本文整理汇总了Python中Tkinter.NSEW属性的典型用法代码示例。如果您正苦于以下问题:Python Tkinter.NSEW属性的具体用法?Python Tkinter.NSEW怎么用?Python Tkinter.NSEW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类Tkinter
的用法示例。
在下文中一共展示了Tkinter.NSEW属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def __init__(self, master=None, **kw):
ttk.Notebook.__init__(self, master, **kw)
style = ttk.Style()
if platform=='darwin':
if map(int, mac_ver()[0].split('.')) >= [10,10]:
# Hack for tab appearance with 8.5 on Yosemite & El Capitan. For proper fix see
# https://github.com/tcltk/tk/commit/55c4dfca9353bbd69bbcec5d63bf1c8dfb461e25
style.configure('TNotebook.Tab', padding=(12,10,12,2))
style.map('TNotebook.Tab', foreground=[('selected', '!background', 'systemWhite')])
self.grid(sticky=tk.NSEW) # Already padded apropriately
elif platform == 'win32':
style.configure('nb.TFrame', background=PAGEBG)
style.configure('nb.TButton', background=PAGEBG)
style.configure('nb.TCheckbutton', foreground=PAGEFG, background=PAGEBG)
style.configure('nb.TMenubutton', foreground=PAGEFG, background=PAGEBG)
style.configure('nb.TRadiobutton', foreground=PAGEFG, background=PAGEBG)
self.grid(padx=10, pady=10, sticky=tk.NSEW)
else:
self.grid(padx=10, pady=10, sticky=tk.NSEW)
示例2: onenter
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def onenter(self, event=None):
if config.getint('theme') > 1:
self.w.attributes("-transparentcolor", '')
self.blank_menubar.grid_remove()
self.theme_menubar.grid(row=0, columnspan=2, sticky=tk.NSEW)
示例3: onleave
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def onleave(self, event=None):
if config.getint('theme') > 1 and event.widget==self.w:
self.w.attributes("-transparentcolor", 'grey4')
self.theme_menubar.grid_remove()
self.blank_menubar.grid(row=0, columnspan=2, sticky=tk.NSEW)
# Run the app
示例4: addpage
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def addpage(self, parent, header=[], align=None):
page = nb.Frame(parent)
page.grid(pady=10, sticky=tk.NSEW)
page.columnconfigure(0, weight=1)
if header:
self.addpageheader(page, header, align=align)
return page
示例5: __init__
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def __init__(self, parent):
tk.LabelFrame.__init__(self, parent, text="Plot Custom Range")
self.parent = parent
self.lab = tk.Label(self, text='Custom range:')
self.rangeVar = tk.StringVar(value='chrX:YYYYYY-ZZZZZZ')
self.entry = tk.Entry(self, textvariable=self.rangeVar, width=25)
self.setter = tk.Button(self, text="Plot Custom", command=self.do_plot)
self.lab.grid(row=0, column=0, sticky=tk.NSEW)
self.entry.grid(row=0, column=1, sticky=tk.NSEW)
self.setter.grid(row=0, column=2, sticky=tk.NSEW)
示例6: set_sample_selector
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def set_sample_selector(self):
if self.sample_selector:
self.sample_selector.destroy()
self.sample_selector = gw.SampleSelector(self, self.par.run.samples, ped=self.par.run.ped)
self.sample_selector.grid(row=1, column=0, sticky=tk.NSEW, padx=10)
示例7: set_genotype_selector
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def set_genotype_selector(self):
if self.genotype_selector:
self.genotype_selector.destroy()
self.genotype_selector = gw.SampleGenotypeSelector(self, self.current_samples)
self.genotype_selector.grid(row=1, column=1, sticky=tk.NSEW, padx=10)
示例8: set_filters
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def set_filters(self):
if self.filters:
self.filters.destroy()
self.filters = gw.Filters(self)
self.filters.grid(row=3, column=0, columnspan=2, sticky=tk.NSEW, pady=2, padx=10)
示例9: set_sv_chooser
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def set_sv_chooser(self):
if self.sv_chooser:
self.sv_chooser.destroy()
self.sv_chooser = gw.SvChooser(self, self.svs, self.par.run.vcf.count)
self.sv_chooser.grid(row=5, column=0, sticky=tk.NSEW, padx=10, columnspan=2)
示例10: set_info_box
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def set_info_box(self, message=''):
if self.info_box:
self.info_box.destroy()
self.info_box = gw.InfoBox(self, message)
self.info_box.grid(row=7, column=0, sticky=tk.NSEW, padx=10, columnspan=2)
示例11: samples_update
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def samples_update(self, idxs):
self.set_info_box()
self.current_samples = []
for idx in idxs:
self.current_samples.append(self.par.run.samples[int(idx)])
self.genotype_selector.destroy()
self.genotype_selector = gw.SampleGenotypeSelector(self, self.current_samples)
self.genotype_selector.grid(row=1, column=1, sticky=tk.NSEW, padx=10)
示例12: show
# 需要导入模块: import Tkinter [as 别名]
# 或者: from Tkinter import NSEW [as 别名]
def show(self):
def tip_pos_calculator(widget, label, tip_delta = (10, 5), pad = (5, 3, 5, 3)):
w = widget
s_width, s_height = w.winfo_screenwidth(), w.winfo_screenheight()
width, height = (pad[0] + label.winfo_reqwidth() + pad[2],
pad[1] + label.winfo_reqheight() + pad[3])
mouse_x, mouse_y = w.winfo_pointerxy()
x1, y1 = mouse_x + tip_delta[0], mouse_y + tip_delta[1]
x2, y2 = x1 + width, y1 + height
x_delta = x2 - s_width
if x_delta < 0:
x_delta = 0
y_delta = y2 - s_height
if y_delta < 0:
y_delta = 0
offscreen = (x_delta, y_delta) != (0, 0)
if offscreen:
if x_delta:
x1 = mouse_x - tip_delta[0] - width
if y_delta:
y1 = mouse_y - tip_delta[1] - height
offscreen_again = y1 < 0 # out on the top
if offscreen_again:
# No further checks will be done.
# TIP:
# A further mod might automagically augment the
# wraplength when the tooltip is too high to be
# kept inside the screen.
y1 = 0
return x1, y1
bg = self.bg
pad = self.pad
widget = self.widget
# creates a toplevel window
self.tw = tk.Toplevel(widget)
# leaves only the label and removes the app window
self.tw.wm_overrideredirect(True)
win = tk.Frame(self.tw, background = bg, borderwidth = 0)
label = ttk.Label(win, text = self.text, justify = tk.LEFT, background = bg, relief = tk.SOLID, borderwidth = 0,
wraplength = self.wraplength)
label.grid(padx = (pad[0], pad[2]), pady = (pad[1], pad[3]), sticky=tk.NSEW)
win.grid()
x, y = tip_pos_calculator(widget, label)
self.tw.wm_geometry("+%d+%d" % (x, y))