欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Python GUI布局尺寸適配方法

 更新時(shí)間:2018年10月11日 09:18:24   作者:houyanhua1  
今天小編就為大家分享一篇Python GUI布局尺寸適配方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧

如下所示:

#coding=utf-8
 
#布局自定義尺寸
from tkinter import *
 
class App:
	def __init__(self,master):
		frame=Frame(master)
		frame.pack(fill=BOTH,expand=1)
		listbox=Listbox(frame)  #listbox=Listbox(frame,height=3,selectmode=BROWSE) #curselection()
		for item in ['red','green','blue','yellow','pink']:
			listbox.insert(END,item)
		listbox.grid(row=0,column=0,sticky=W+E+N+S) # sticky 適配
		text=Text(frame,relief=SUNKEN)
		text.grid(row=0,column=1,sticky=W+E+N+S)
		text.insert(END,'word'*1000)
		frame.columnconfigure(1,weight=1) #尺寸適配 
		frame.rowconfigure(0,weight=1)  #尺寸適配
		
		#Spinbox(frame,values=('a','b','c')).grid(row=3) #get()
 
root=Tk()
root.wm_title('尺寸適配')
app=App(root)
root.geometry("400x300+0+0")  #尺寸適配
root.mainloop()
 

以上這篇Python GUI布局尺寸適配方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論