本文整理汇总了Python中tkinter.Frame.pack_propagate方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.pack_propagate方法的具体用法?Python Frame.pack_propagate怎么用?Python Frame.pack_propagate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Frame
的用法示例。
在下文中一共展示了Frame.pack_propagate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: additems
# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import pack_propagate [as 别名]
def additems(i, doreturn=False, bgcolor="#555"):
returnable = []
for item in i:
global totalitems
totalitems += 1
ff = Frame(f, bg=bgcolor)
item.body = item.author.name + ' || ' + item.fullname + '\n' + item.body
item.body = str(totalitems) + '\n' + item.body
ibody = item.body.replace('\n\n', '\n')
ifinal = ''
for paragraph in ibody.split('\n'):
ifinal += '\n'.join(textwrap.wrap(paragraph))
ifinal += '\n'
item.body = ifinal
ww = 680
wh = 10
wx = 20
wy = 20
#print(ww, wh, wx, wy)
ff.ww = ww
ff.wh = wh
ff.wx = wx
ff.wy = wy
ff.body = item.body
ff.sourceitem = item
ff.configure(width=ww, height=wh)
ff.place(x=wx, y=wy)
ff.bind("<B1-Motion>", framedrag)
ff.bind("<ButtonRelease-1>", resetdrag)
ff.pack_propagate(0)
l = Label(ff, text=item.body, bg="#777")
l.place(x=10,y=10)
rt = Text(ff, width= 15, height= (len(ifinal.split('\n'))) - 2)
rt.sourceitem = item
rt.place(x=400,y=10)
rb = Button(ff, text="Reply", command= lambda rep=rt: reply(rep))
rb.place(x=400,y=wh-20)
ff.rt = rt
ff.rb = rb
if not doreturn:
widgets.append(ff)
else:
returnable.append(ff)
if doreturn:
return returnable
else:
refreshscreen()
示例2: Xls2kml
# 需要导入模块: from tkinter import Frame [as 别名]
# 或者: from tkinter.Frame import pack_propagate [as 别名]
#.........这里部分代码省略.........
command=lambda: (self.__open_file(docs[3])))
gpsmenu.add_command(label="Google Earth",
command=lambda: (self.__open_file(docs[4])))
cellmenu = Menu(exemplemenu)
exemplemenu.add_cascade(label="Células Telefónicas", menu=cellmenu)
cellmenu.add_command(label="Excel",
command=lambda: (self.__open_file(docs[5])))
cellmenu.add_command(label="Google Earth",
command=lambda: (self.__open_file(docs[6])))
fotomenu = Menu(exemplemenu)
exemplemenu.add_cascade(label="Fotos", menu=fotomenu)
fotomenu.add_command(label="Excel",
command=lambda: (self.__open_file(docs[7])))
fotomenu.add_command(label="Google Earth",
command=lambda: (self.__open_file(docs[8])))
squaremenu = Menu(exemplemenu)
exemplemenu.add_cascade(label="Quadrado", menu=squaremenu)
squaremenu.add_command(label="Excel",
command=lambda: (self.__open_file(docs[9])))
squaremenu.add_command(label="Google Earth",
command=lambda: (self.__open_file(docs[10])))
helpmenu = Menu(self.menu)
self.menu.add_cascade(label='Ajuda', menu=helpmenu)
helpmenu.add_command(label="Sobre", command=self.__about)
helpmenu.add_command(label="Ver erros",
command=lambda: (self.__open_file("erros.log")))
# Frame to suport butons, labels and separators ----------------
self.f = Frame(self.master, bg=bg)
self.f.pack_propagate(0) # don't shrink
self.f.pack(side=BOTTOM, padx=0, pady=0)
# Message and Labels -------------------------------------------
self.l1 = Message(
self.f, bg=bg1, bd=5, fg=bg, textvariable=self.message,
font=("Helvetica", "13", "bold italic"), width=500).grid(
row=0, columnspan=6, sticky=EW, padx=5, pady=5)
self.l2 = Label(
self.f, image=self.img, fg=bg
).grid(row=1, columnspan=6, padx=5, pady=2)
self.l6 = Label(
self.f, text=text, font=("Helvetica", "11", "bold"), bg=bg, fg=bg1
).grid(row=3, column=2, columnspan=3, sticky=EW, pady=5)
# Buttons ------------------------------------------------------
self.b0 = Button(
self.f, text="Abrir EXCEL...", command=self.__callback, width=10,
bg="forest green", fg=fc, font=font
).grid(row=3, column=0, padx=5, sticky=W)
self.b1 = Button(
self.f, text="Gravar KMZ", command=self.__callback_2, width=10,
bg="DodgerBlue4", fg=fc, font=font
).grid(row=3, column=1, sticky=W)
self.b2 = Button(
self.f, text="Sair", command=self.__callback_3, width=10,
bg="orange red", fg=fc, font=font
).grid(row=3, column=5, sticky=E, padx=5)
# Separator ----------------------------------------------------
# self.s = ttk.Separator(self.f, orient=HORIZONTAL).grid(
# row=4, columnspan=5, sticky=EW, padx=5, pady=5)