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 ...
随机推荐
- YXY的测试流程
不同的公司测试流程都会不一样
- PHP循环嵌套例子
循环嵌套1.实现如下效果:第一行第二行第三行第四行第五行1 2 3 4 51 2 3 4 51 2 3 4 51 2 3 4 52.实现如下效果图:第一行第二行第三行第四行第五行1 2 3 4 56 ...
- linux 系统优化+定时任务
安装软件 通过yum安装 自动补全工具:yum completion yum install -y tree bash-completion wget vim find -[TAB] 更改系统的yum ...
- vuex(三)actions
actions:既然mutations只能处理同步函数,我大js全靠‘异步回调’吃饭,怎么能没有异步,于是actions出现了... actions和mutations的区别 1.Acti ...
- Sprint Boot 学习Q&A
[ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.1.11:revision (default) on ...
- 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 ...
- BZOJ1878 SDOI2009 HH的项链 【莫队】
BZOJ1878 SDOI2009 HH的项链 Description HH有一串由各种漂亮的贝壳组成的项链.HH相信不同的贝壳会带来好运,所以每次散步 完后,他都会随意取出一段贝壳,思考它们所表达的 ...
- iOS中scrollview自动滚动的实现
http://bbs.csdn.net/topics/390347330 原问题是,我要展现给用户的内容放在scrollview中,让内容从上到底自动滚动,我最开始用的是DDAutoscrollvie ...
- Hbase rowkey热点问题
当处理由连续事件得到的数据时,即时间上连续的数据.这些数据可能来自于某个传感器网络.证券交易或者一个监控系统.它们显著的特点就是rowkey中含有事件发生时间.带来的一个问题便是HBase对于row的 ...
- __all__ 作用, 相当于导入*
它是一个string元素组成的list变量,定义了当你使用 from <module> import * 导入某个模块的时候能导出的符号(这里代表变量,函数,类等) 参考文章: http: ...