Tkinter LabelFrame
该部件有一帧的功能,加上能够显示标签.
语法:
这里是一个简单的语法来创建这个widget:
w = LabelFrame( master, option, ... )
参数:
master: 这代表了父窗口.
options: 下面是这个小工具最常用的选项列表。这些选项可以作为键 - 值对以逗号分隔.
| Option | Description |
|---|---|
| bg | The normal background color displayed behind the label and indicator. |
| bd | The size of the border around the indicator. Default is 2 pixels. |
| cursor | If you set this option to a cursor name (arrow, dot etc.), the mouse cursor will change to that pattern when it is over the checkbutton. |
| font | The vertical dimension of the new frame. |
| height | The vertical dimension of the new frame. |
| labelAnchor | Specifies where to place the label. |
| highlightbackground | Color of the focus highlight when the frame does not have focus. |
| highlightcolor | Color shown in the focus highlight when the frame has the focus. |
| highlightthickness | Thickness of the focus highlight. |
| relief | With the default value, relief=FLAT, the checkbutton does not stand out from its background. You may set this option to any of the other styles |
| text | Specifies a string to be displayed inside the widget. |
| width | Specifies the desired width for the window. |
例子:
自己尝试下面的例子。下面是如何创建3窗格部件:
from Tkinter import * root = Tk() labelframe = LabelFrame(root, text="This is a LabelFrame")
labelframe.pack(fill="both", expand="yes") left = Label(labelframe, text="Inside the LabelFrame")
left.pack() root.mainloop()
这将产生以下结果:

Tkinter LabelFrame的更多相关文章
- gui - tkinter 开发
GUI 用户交互界面 tkinter 介绍 tkinter python自带的gui库,对图形图像处理库tk的封装 其他gui:pythonwin,wxpython,pyQT.. 概念介绍 组件:组成 ...
- python tkinter-容器、子窗体
Frame f = tkinter.Frame(width=380, height=270, bg='white').pack() LabelFrame f = tkinter.LabelFram ...
- (6)python tkinter-容器、子窗体
Frame f = tkinter.Frame(width=380, height=270, bg='white').pack() LabelFrame f = tkinter.LabelFrame( ...
- Tkinter--Text文本框样例
#-*- coding:utf-8 -*- """ Text 文本框样例 实现功能有:Ctrl+a全选文本, 竖向滚动条,横向滚动条(不自动换行) 自动缩放 有谁知道全选 ...
- Python-tkinter开发学习 笔记
目录 课时一 kinter 介绍 查询官方帮助:help(tkinter) 概念介绍 最简单的界面 实现简单的模块 组件的摆放方式 pack()方式例子 gird() 方式例子 place方式例子 课 ...
- python_tkinter组件
1.按钮 # 按钮 # bg设置背景色 btn = tkinter.Button(root,text = '按钮',bg = 'red') btn.pack() # fg设置前景色(文字颜色) btn ...
- tkinter学习系列之(七)Frame与Labelframe 控件
目录 目录 前言 (一)Frame (二)Labelframe 目录 前言 Frame与Labelframe都是容器,用来存放其他控件,也是用来更好的管理布局. 我一般是用来存放一组相关的控件,让Fr ...
- Python3 tkinter基础 LabelFrame Radiobutton 形成两组不相互限制的单选按钮
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- GUI的最终选择 Tkinter(三):Checkbutton组件和Radiobutton组件、LabelFrame组件
Checkbutton组件 Checkbutton组件就是常见的多选按钮,而Radiobutton则是单选按钮 from tkinter import * root = Tk() v = IntVar ...
随机推荐
- python中对文件的处理
1.当文件中存放的用户名的密码,是以字符串的形式存储时,怎么进行读取和操作 eg:MLing,123456 niuniu,234567 luoluo,345678 方法一:将字符串转为字典 1)字典查 ...
- python全局替换文件内容脚本第1版
#!/usr/bin/python #coding=utf8 """ # Author: xiaoyafei # Created Time : 2018-05-08 09 ...
- mailto web弹出outlook发送邮件
1. <pre name="code" class="html"><a href="Mailto:test@163.com?CC=t ...
- 解决TensorFlow最新代码编译错误问题
老是有个习惯,看到开源代码更新了,总是想更新到最新版,如果置之不理的话,就感觉自己懒惰了或有的不负责任了,这个也可能是一种形式的强迫症吧: 前几天晚上git pull TensorFlow,完事后也没 ...
- linux环境搭建记录
第一次搭建环境,部署服务,在此记录一下过程 1.项目用到的hosts设置好 2.mkdir data,在data文件夹下建server,log,soft,resource路径,上载jdk.zip到so ...
- 用with来打开文本文件
with open ('text.txt') as f: for line in f.readlines(): print(line) 这种方法的好处就是如果出了异常也会自动提示报错.
- 开源中文检索引擎Coreseek简单使用
Coreseek结合MySQL使用简单示例,如下所示: echo 北京 | iconv -f gbk -t utf-8 | search -c D:\web\coreseek\etc\csft_mys ...
- 监听器(Listener)学习(二)在开发中的常见应用
监听器在JavaWeb开发中用得比较多,下面说一下监听器(Listener)在开发中的常见应用: 统计当前在线人数 自定义Session扫描器 一.统计当前在线人数 在JavaWeb应用开发中,有时候 ...
- LOJ2321. 「清华集训 2017」无限之环【费用流】
LINK 很好的一道网络里题 首先想插头DP的还是出门左转10分代码吧 然后考虑怎么网络流 首先要保证没有漏水 也就是说每个接口一定要有对应的接口 那么发现每个点只有可能和上下左右四个点产生联通关系 ...
- BZOJ2431 HAOI2009 逆序对数列 【DP】*
BZOJ2431 HAOI2009 逆序对数列 Description 对于一个数列ai{a_i}ai,如果有i<j且ai>aja_i>a_jai>aj,那么我们称aia ...