
Python GUI布局的尺寸适应方法
5星
- 浏览量: 0
- 大小:None
- 文件类型:None
简介:
本文章介绍了在使用Python进行GUI开发时如何使界面元素自动调整大小以适应不同屏幕尺寸的方法和技术。
#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]:
pass # 原代码此处应有添加项目到列表框的语句,但未给出具体内容。
全部评论 (0)
还没有任何评论哟~


