当前位置: 移动技术网 > IT编程>脚本编程>Python > Python GUI布局尺寸适配方法

Python GUI布局尺寸适配方法

2019年05月24日  | 移动技术网IT编程  | 我要评论

大话英雄粤语,1976烤翅加盟,永州火车站

如下所示:

#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布局尺寸适配方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网