Tkinter PanedWindow: 一个PanedWindow是一个容器部件可能包含任何数量的窗格,水平或垂直排列
一个PanedWindow是一个容器部件可能包含任何数量的窗格,水平或垂直排列.

每个窗格中包含一个部件,每一双窗格由一个可移动的(通过鼠标移动)窗扇分开。移动窗扇导致要么被调整窗框侧面的部件.

语法:

这里是一个简单的语法来创建这个widget:

w = PanedWindow( master, option, ... )

参数:

  • master: 这代表了父窗口.

  • options:下面是这个小工具最常用的选项列表。这些选项可以作为键 - 值对以逗号分隔.

Option Description
bg The color of the slider and arrowheads when the mouse is not over them.
bd The width of the 3-d borders around the entire perimeter of the trough, and also the width of the 3-d effects on the arrowheads and slider. Default is no border around the trough, and a 2-pixel border around the arrowheads and slider.
borderwidth Default is 2.
cursor The cursor that appears when the mouse is over the window.
handlepad Default is 8.
handlesize Default is 8.
height No default value.
orient Default is HORIZONTAL.
relief Default is FLAT.
sashcursor No default value.
sashrelief Default is RAISED.
sashwidth Default is 2.
showhandle No default value
width No default value.

方法:

spinbox对象有这些方法:

Methods & Description
add(child, options)
Adds a child window to the paned window.
get(startindex [,endindex])
This method returns a specific character or a range of text.
config(options)
Modifies one or more widget options. If no options are given, the method returns a dictionary containing all current option values.

例子:

自己尝试下面的例子。下面是如何创建3窗格部件:

from Tkinter import *

m1 = PanedWindow()
m1.pack(fill=BOTH, expand=1) left = Label(m1, text="left pane")
m1.add(left) m2 = PanedWindow(m1, orient=VERTICAL)
m1.add(m2) top = Label(m2, text="top pane")
m2.add(top) bottom = Label(m2, text="bottom pane")
m2.add(bottom) mainloop()

这将产生以下结果:

 

最新文章

  1. (转)JS获取当前对象大小以及屏幕分辨率等
  2. 将ubuntu的id_rsa秘钥转为putty的ppk格式
  3. TCPIP,Http,Socket的区别
  4. Neutron分析(6)—— neutron-openvswitch-agent
  5. 20169210《Linux内核原理与分析》课程总结
  6. NGUI 按钮音效问题
  7. struct 和 class 不同点
  8. 由<a href = "#" > 引发的思考
  9. Linux haproxy配置参数
  10. overall error
  11. shell 文件操作
  12. Android View 绘制流程
  13. linux系统下find命令的使用
  14. CodeForces - 896A Nephren gives a riddle
  15. Linux服务器---流量监控webalizer
  16. 腾讯云申请的64位ubuntu服务器配置php环境
  17. 训练赛第二场G题 ZOJ 2343
  18. DNS服务器配置实践
  19. ubuntu18 tensorflow faster_rcnn cpu训练自己数据集
  20. 区块链~Merkle Tree(默克尔树)算法解析~转载

热门文章

  1. Jenkins简单的使用
  2. 更换pip源,解决pip install安装包慢的问题
  3. ios6:新特征介绍
  4. 【剑指offer-21】调整数组顺序使奇数位于偶数前面,C++实现(冒泡排序)
  5. 利用ajax完成项目图册上传删除【实际项目】
  6. BZOJ2152 聪聪可可 【点分治】
  7. .NET 中 GetProcess 相关方法的性能
  8. Palindrome Degree(hash的思想题)
  9. BZOJ1556 墓地秘密
  10. PDF去除签名