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()

这将产生以下结果:

 

Tkinter PanedWindow的更多相关文章

  1. gui - tkinter 开发

    GUI 用户交互界面 tkinter 介绍 tkinter python自带的gui库,对图形图像处理库tk的封装 其他gui:pythonwin,wxpython,pyQT.. 概念介绍 组件:组成 ...

  2. python_tkinter组件

    1.按钮 # 按钮 # bg设置背景色 btn = tkinter.Button(root,text = '按钮',bg = 'red') btn.pack() # fg设置前景色(文字颜色) btn ...

  3. GUI的最终选择 Tkinter(八):Message组件、Spinbox组件、PanedWindow组件、Toplevel组件

    Message组件 Message(消息)组件是Label组件的变体,用于显示多行文本消息,Message组件能够自动执行,并调整文本的尺寸使其适应给定的尺寸. from tkinter import ...

  4. Tkinter 之PanedWindow标签

    一.参数说明 参数 作用 background(bg) 设置背景颜色 borderwidth(bd) 设置边框宽度 cursor  指定当鼠标在PanedWindow上飘过的时候的鼠标样式 handl ...

  5. TKinter的常用组件

    python提供了多个图形开发界面的库,几个常用Python GUI库如下: Tkinter: Tkinter模块("Tk 接口")是Python的标准Tk GUI工具包的接口.T ...

  6. Python GUI之tkinter窗口视窗教程大集合(看这篇就够了)

    一.前言 由于本篇文章较长,所以下面给出内容目录方便跳转阅读,当然也可以用博客页面最右侧的文章目录导航栏进行跳转查阅. 一.前言 二.Tkinter 是什么 三.Tkinter 控件详细介绍 1. T ...

  7. python3内置的tkinter参数释疑

    最近涉及到需要实现一个桌面UI的小游戏,所以就翻看了一些文档. 当然有介绍使用pyQT5的,但是本机安装的是python3.4,不想卸载掉这个版本,暂时还不能使用pyQT5. pyQT5需要pytho ...

  8. tkinter模块

    Python GUI编程(Tkinter) Python 提供了多个图形开发界面的库,几个常用 Python GUI 库如下: Tkinter: Tkinter 模块(Tk 接口)是 Python 的 ...

  9. python---基础知识回顾(九)图形用户界面-------Tkinter

    前戏:老牌python GUI程序(Tkinter) import tkinter.messagebox as messagebox class Application(Frame): def __i ...

随机推荐

  1. java 多线程超详细总结——阿里大牛熬夜整理

    引 如果对什么是线程.什么是进程仍存有疑惑,请先Google之,因为这两个概念不在本文的范围之内. 用多线程只有一个目的,那就是更好的利用cpu的资源,因为所有的多线程代码都可以用单线程来实现.说这个 ...

  2. Linux RTC Test Example rtctest.c hacking

    /********************************************************************** * Linux RTC Test Example rtc ...

  3. 【集成学习】lightgbm使用案例

    github地址 #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sat Mar 31 21: ...

  4. day3 文件系统 内核模块 ctags

    nfs网络文件系统 smb   修改配置文件  sudo  vim /etc/samba/smb.conf    重启服务   /etc/init.d/samba restart 自制小的文件系统 1 ...

  5. [转]Java 8新特性探究(lambda)

    原文地址:http://my.oschina.net/benhaile/blog/175012 目录[-] 函数式接口 Lambda语法 方法引用 总结 函数式接口 函数式接口(functional ...

  6. enum枚举类型的定义

    enum枚举类型的定义方式与某种用法 #include <iostream> using namespace std; int main() { enum TOT{ zero, one, ...

  7. object references an unsaved transient instance - save the transient instance before flushing: com.jspxcms.core.domain.ScTeam

    object references an unsaved transient instance - save the transient instance before flushing: com.j ...

  8. C#/.NET 中推荐的 Dispose 模式的实现

    如果你觉得你的类需要实现 IDisposable 接口,还是需要注意一些坑的.不过前人准备了 Dispose 模式 供我们参考,最大程度避免这样的坑. C#程序中的 Dispose 方法,一旦被调用了 ...

  9. IOS UIView 放大缩小

    /创建缩小了的视图myWeiBoImageVC = [[UIViewController alloc] init];myWeiBoImageVC.view.clipsToBounds = YES;my ...

  10. github上对一些名词的理解(之如fork)

    fork: Fork 的本义是 叉子(名词) . 比较自然的引申成 分叉(动词) ,就像上面叉子,从左到从右,一条线变成多条了. Git/GitHub 用户下面的图 来表达 Fork:分叉.克隆 出一 ...