本文整理汇总了Python中tkinter.Toplevel.configure方法的典型用法代码示例。如果您正苦于以下问题:Python Toplevel.configure方法的具体用法?Python Toplevel.configure怎么用?Python Toplevel.configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Toplevel
的用法示例。
在下文中一共展示了Toplevel.configure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _object_browser
# 需要导入模块: from tkinter import Toplevel [as 别名]
# 或者: from tkinter.Toplevel import configure [as 别名]
def _object_browser(parent): # htest #
import sys
from tkinter import Toplevel
top = Toplevel(parent)
top.title("Test debug object browser")
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
top.geometry("+%d+%d"%(x + 100, y + 175))
top.configure(bd=0, bg="yellow")
top.focus_set()
sc = ScrolledCanvas(top, bg="white", highlightthickness=0, takefocus=1)
sc.frame.pack(expand=1, fill="both")
item = make_objecttreeitem("sys", sys)
node = TreeNode(sc.canvas, None, item)
node.update()
示例2: __about
# 需要导入模块: from tkinter import Toplevel [as 别名]
# 或者: from tkinter.Toplevel import configure [as 别名]
def __about(self):
'''
None -> None
Associated with the Help Menu.
Creates a new window with the "About" information
'''
appversion = "1.6"
appname = "EXCEL to KML Transformer"
copyright = 14 * ' ' + '(c) 2013' + 12 * ' ' + \
'SDATO - DP - UAF - GNR\n' + 34 * ' '\
+ "All Rights Reserved"
licence = 18 * ' ' + 'http://opensource.org/licenses/GPL-3.0\n'
contactname = "Nuno Venâncio"
contactphone = "(00351) 969 564 906"
contactemail = "[email protected]"
message = "Version: " + appversion + 5 * "\n"
message0 = "Copyright: " + copyright + "\n" + "Licença: " + licence
message1 = contactname + '\n' + contactphone + '\n' + contactemail
icons = os.getcwd() + os.sep + "icons" + os.sep # path to icons
icon = icons + "compass.ico"
tl = Toplevel(self.master)
tl.configure(borderwidth=5)
tl.title("Sobre...")
tl.iconbitmap(icon)
tl.resizable(width=FALSE, height=FALSE)
f1 = Frame(tl, borderwidth=2, relief=SUNKEN, bg="gray25")
f1.pack(side=TOP, expand=TRUE, fill=BOTH)
l0 = Label(f1, text=appname, fg="white", bg="gray25",
font=('courier', 16, 'bold'))
l0.grid(row=0, column=0, sticky=W, padx=10, pady=5)
l1 = Label(f1, text=message, justify=CENTER,
fg="white", bg="gray25")
l1.grid(row=2, column=0, sticky=E, columnspan=3, padx=10, pady=0)
l2 = Label(f1, text=message0,
justify=LEFT, fg="white", bg="gray25")
l2.grid(row=6, column=0, columnspan=2, sticky=W, padx=10, pady=0)
l3 = Label(f1, text=message1,
justify=CENTER, fg="white", bg="gray25")
l3.grid(row=7, column=0, columnspan=2, padx=10, pady=0)
button = Button(tl, text="Ok", command=tl.destroy, width=10)
button.pack(pady=5)
示例3: newWindow
# 需要导入模块: from tkinter import Toplevel [as 别名]
# 或者: from tkinter.Toplevel import configure [as 别名]
def newWindow(self, parent):
random.seed()
colorInt = random.randint(0,2)
if colorInt == 0:
bgColor = "red"
elif colorInt == 1:
bgColor = "white"
else:
bgColor = "blue"
top = Toplevel()
winWidth, winHeight = 200, 200
top.minsize(width=winWidth, height=winHeight)
top.title("New!")
top.configure(background=bgColor)
label = Label(top, text=("This window has a " + str(bgColor) +
" background!"))
label.pack(side="top")
but = Button(top, text="New Window",
command= lambda: self.newWindow(parent))
but.pack(expand=True)
but2 = Button(top, text="Close All", command=parent.destroy)
but2.pack(side="bottom")
but3 = Button(top, text="Close Current", command=top.destroy)
but3.pack(side="bottom")