Tkinter 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()
这将产生以下结果:
Tkinter PanedWindow的更多相关文章
- gui - tkinter 开发
GUI 用户交互界面 tkinter 介绍 tkinter python自带的gui库,对图形图像处理库tk的封装 其他gui:pythonwin,wxpython,pyQT.. 概念介绍 组件:组成 ...
- python_tkinter组件
1.按钮 # 按钮 # bg设置背景色 btn = tkinter.Button(root,text = '按钮',bg = 'red') btn.pack() # fg设置前景色(文字颜色) btn ...
- GUI的最终选择 Tkinter(八):Message组件、Spinbox组件、PanedWindow组件、Toplevel组件
Message组件 Message(消息)组件是Label组件的变体,用于显示多行文本消息,Message组件能够自动执行,并调整文本的尺寸使其适应给定的尺寸. from tkinter import ...
- Tkinter 之PanedWindow标签
一.参数说明 参数 作用 background(bg) 设置背景颜色 borderwidth(bd) 设置边框宽度 cursor 指定当鼠标在PanedWindow上飘过的时候的鼠标样式 handl ...
- TKinter的常用组件
python提供了多个图形开发界面的库,几个常用Python GUI库如下: Tkinter: Tkinter模块("Tk 接口")是Python的标准Tk GUI工具包的接口.T ...
- Python GUI之tkinter窗口视窗教程大集合(看这篇就够了)
一.前言 由于本篇文章较长,所以下面给出内容目录方便跳转阅读,当然也可以用博客页面最右侧的文章目录导航栏进行跳转查阅. 一.前言 二.Tkinter 是什么 三.Tkinter 控件详细介绍 1. T ...
- python3内置的tkinter参数释疑
最近涉及到需要实现一个桌面UI的小游戏,所以就翻看了一些文档. 当然有介绍使用pyQT5的,但是本机安装的是python3.4,不想卸载掉这个版本,暂时还不能使用pyQT5. pyQT5需要pytho ...
- tkinter模块
Python GUI编程(Tkinter) Python 提供了多个图形开发界面的库,几个常用 Python GUI 库如下: Tkinter: Tkinter 模块(Tk 接口)是 Python 的 ...
- python---基础知识回顾(九)图形用户界面-------Tkinter
前戏:老牌python GUI程序(Tkinter) import tkinter.messagebox as messagebox class Application(Frame): def __i ...
随机推荐
- 使用json path设置关联
与正则表达式相比,这种方法会更简单一些: json path是在返回的是K-V的格式中根据key进行的关联,如果压的接口返回的是json的话,使用json path比较方便,如果不是json的话,就使 ...
- img 在chrome和Firefox下的兼容性
Firefox 5.下:没有重叠在一起: chrome 下: 两个重叠在一起, 原因: img标签,在两个浏览器下展示效果不一样, 解决办法:指明展示:
- moment时间转换插件
在vue中的使用: import moment = from “moment” Vue.prototype.$moment = moment; 获取时间戳 : var res = this.$mome ...
- HDU3652 B-number 数位DP第二题
A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- ...
- java大文件断点续传
java两台服务器之间,大文件上传(续传),采用了Socket通信机制以及JavaIO流两个技术点,具体思路如下: 实现思路:1.服:利用ServerSocket搭建服务器,开启相应端口,进行长连接操 ...
- Python学习-第三方库操作
2018-05-04 12:03:19 Python安装模块,更新模块 #显示模块 pip list #显示过期模块 pip list --outdated #安装模块 pip install x ...
- Appium + Python App自动化(2)第一个脚本
[1]打开你的夜神模拟器(或者连接你的手机) [2]打开桌面的Appium [3]下载你要测的App的apk文件,放到桌面 [4]拖动你的apk安装包到夜神模拟器里,然后模拟器会提示你安装.安装.原来 ...
- SQL Server 2008 R2占用内存越来越大解决方法
最近开发sql server数据库项目的过程中发现了这么一个问题,后台网站内存占用95%,通过任务管理器查看占内存的进程sqlserver.exe,是因为SQL Server 2008 R2运行越久, ...
- 【剑指offer】Q14:调整数组顺序使奇数位于偶数前面
def isOdd(n): return n & 1 def Reorder(data, cf = isOdd): odd = 0 even = len( data ) - 1 while T ...
- 异常处理—Exception(三)
最近有点事,把这个系列给落下了,给大家道个歉,这里还要感谢我的老婆,谢谢她一直对我的支持:) 系列回顾: 1.异常处理--Exception(一) 2.异常处理—Exception(二) 上一篇中主要 ...