Tkinter LabelFrame: 在一个labelframe一个简单的容器构件。其主要目的是作为一个间隔或复杂的窗口布局容器.
在一个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的更多相关文章

  1. gui - tkinter 开发

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

  2. python tkinter-容器、子窗体

      Frame f = tkinter.Frame(width=380, height=270, bg='white').pack() LabelFrame f = tkinter.LabelFram ...

  3. (6)python tkinter-容器、子窗体

    Frame f = tkinter.Frame(width=380, height=270, bg='white').pack() LabelFrame f = tkinter.LabelFrame( ...

  4. Tkinter--Text文本框样例

    #-*- coding:utf-8 -*- """ Text 文本框样例 实现功能有:Ctrl+a全选文本, 竖向滚动条,横向滚动条(不自动换行) 自动缩放 有谁知道全选 ...

  5. Python-tkinter开发学习 笔记

    目录 课时一 kinter 介绍 查询官方帮助:help(tkinter) 概念介绍 最简单的界面 实现简单的模块 组件的摆放方式 pack()方式例子 gird() 方式例子 place方式例子 课 ...

  6. python_tkinter组件

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

  7. tkinter学习系列之(七)Frame与Labelframe 控件

    目录 目录 前言 (一)Frame (二)Labelframe 目录 前言 Frame与Labelframe都是容器,用来存放其他控件,也是用来更好的管理布局. 我一般是用来存放一组相关的控件,让Fr ...

  8. Python3 tkinter基础 LabelFrame Radiobutton 形成两组不相互限制的单选按钮

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  9. GUI的最终选择 Tkinter(三):Checkbutton组件和Radiobutton组件、LabelFrame组件

    Checkbutton组件 Checkbutton组件就是常见的多选按钮,而Radiobutton则是单选按钮 from tkinter import * root = Tk() v = IntVar ...

随机推荐

  1. 重学CPP

    LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt After install ...

  2. iOS NSString相关问题

    1.NSString对象的创建 // 1.创建不可变字符串 NSString *str1 = @"create string"; #pragma mark 对象方法创建字符串 // ...

  3. 【剑指offer】链表中倒数第k个节点,C++实现(链表)

    1.题目 输入一个链表,输出该链表中倒数第k个结点.链表的尾节点是倒数第一个节点. struct ListNode { int val; struct ListNode *next; } 2.思路   ...

  4. [QT]数据库SQLITE使用错误记录

    1.仿照创建数据库的例程编写代码,出现以下问题: ① 创建QSqlQuery query;   注意:这里没有将 query 与 QSqlSatabase db, 关联,正确的应该是 : QSqlQu ...

  5. 使用HttpURLConnection请求multipart/form-data类型的form提交

    写一个小程序,模拟Http POST请求来从网站中获取数据.使用Jsoup(http://jsoup.org/)来解析HTML. Jsoup封装了HttpConnection的功能,可以向服务器提交请 ...

  6. Adobe Acrobat 9 Pro破解方法

    首先安装Adobe Acrobat 9 Pro,默认安装在C盘. 如果你的系统盘是C盘,那么就删除:c:/Documents and Settings/All Users/Application Da ...

  7. Python学习-类

    类是对象的模板或蓝图,类是对象的抽象化,对象是类的实例化 在python中,一个对象的特征也称为属性(attribute),它所具有的的行为也称为方法(method) 对象 = 属性(特征)+方法(行 ...

  8. memsql 基本安装试用

    备注:使用docker 进行安装 1. 基本准备 a. 环境检查(必须,不然会有服务启动异常的问题) docker run --rm memsql/quickstart check-system b. ...

  9. web 优化原则

    1. 减少http 请求   2. 使用CDN   3. 添加expires 头   4. gzip 压缩   5. 样式表放在头部   6. 脚本放底部   7. 避免css 表达式   8. 使用 ...

  10. 7个GIF动图帮你瞬间理解三角函数

    7个GIF动图帮你瞬间理解三角函数 蝌蚪五线谱 百家号04-2120:53 图片来源:IMGUR 三角函数是数学中研究三角形的一个分支,专门阐述三角形的角度和对应边的关系. 有趣的是,定义边角关系的三 ...