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. 重写alert 方法(我胡汉三又回来了)

    window.alert = function (txt) { var shield = document.createElement("DIV"); shield.id = &q ...

  2. Chrome调试javacript禁止缓存

    /********************************************************************* * Chrome调试javacript禁止缓存 * 说明: ...

  3. 【排序】选择排序,C++实现

    # 基本思想 每一趟从待排序的数据元素中选择最小(或最大)的一个元素作为首元素,直到所有元素排完为止. 排序实例 初始关键字 [49 38 65 97 76 13 27 49] 第一趟排序后 13 [ ...

  4. erl_0016 《硝烟中的erlang》 读书笔记003 “error_logger 爆炸”

    error_logger 爆炸 具有讽刺意味的是,负责错误日志的进程竟然是最为脆弱的之一.在Erlang的缺省安装中,error_logger39负责记录日志(写入磁盘或者发送到网络上),它的速度要比 ...

  5. 自动将 NuGet 包的引用方式从 packages.config 升级为 PackageReference

    在前段时间我写了一篇迁移 csproj 格式的博客 将 WPF.UWP 以及其他各种类型的旧样式的 csproj 文件迁移成新样式的 csproj 文件,不过全过程是手工进行的,而且到最后处理 XAM ...

  6. minio 安装以及使用

    1. 为了方便使用 docker 安装 docker run -p 9000:9000 minio/minio server /export   注意启动显示的 appkey secretkey  C ...

  7. element popover 不显示/不隐藏问题解决方法

    html代码部分 <el-table-column label="操作"> <template slot-scope="scope"> ...

  8. cacti监控linux主机时iptables阻碍了udp161端口造成无法监控解

    由于在添加linux主机时,有防火墙启用,造成无法监控linux主机,现有两种方法解决无法监控linux主机问题:可以通过在监控主机执行该命令: snmpwalk -c public -v 2c 19 ...

  9. 笔记:Node.js 的 Buffer 缓冲区

    笔记:Node.js 的 Buffer 缓冲区 node.js 6.0 之前创建的 Buffer 对象使用 new Buffer() 构造函数来创建对象实例,但权限很大,可以获得敏感信息,所以建议使用 ...

  10. [LeetCode系列]组合和枚举问题

    给定一列数(未排序)和一个目标值, 找出所有可能的组合和等于目标值的组合, 数组中的数可以重复使用. 算法思路: 使用递归. 对数组排序, 从小到大; 令i = 起始下标(初始为0), 对于每一个数, ...