PyGobject(十)布局容器之Button篇——Gtk.CheckButton
来源:互联网 发布:淘宝黑刷干货 编辑:程序博客网 时间:2024/05/21 04:41
Gtk.CheckButton
继承关系
Gtk.CheckButton复选框。Gtk.CheckButton是Gtk.ToggleButton的直接子类
Methods
Virtual Methods
例子
代码:
#!/usr/bin/env python3# Created by xiaosanyu at 16/6/14# section 011TITLE = "CheckButton"DESCRIPTION = """A Gtk.CheckButton places a discrete Gtk.ToggleButton next to a widget,(usually a Gtk.Label). See the section on Gtk.ToggleButton widgets for more information about toggle/check buttons.The important signal ( Gtk.ToggleButton ::toggled ) is also inherited from Gtk.ToggleButton."""import gigi.require_version('Gtk', '3.0')from gi.repository import Gtkclass CheckButtonWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="CheckButton Demo") self.set_border_width(10) hbox = Gtk.Box(spacing=6) self.add(hbox) button1 = Gtk.CheckButton.new_with_label("Check Button") button1.connect("toggled", self.on_button_toggled) hbox.pack_start(button1, False, False, 0) @staticmethod def on_button_toggled(button): if button.get_active(): state = "check" else: state = "not check" print("Button was", state)def main(): win = CheckButtonWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()if __name__ == "__main__": main()
使用方法同Gtk.ToggleButton
只是多一个复选框而已
代码下载地址:http://download.csdn.net/detail/a87b01c14/9594728
0 0
- PyGobject(十)布局容器之Button篇——Gtk.CheckButton
- PyGobject(五)布局容器之Button篇——Gtk.Button
- PyGobject(六)布局容器之Button篇——Gtk.ColorButton
- PyGobject(七)布局容器之Button篇——Gtk.FontButton
- PyGobject(八)布局容器之Button篇——Gtk.LinkButton
- PyGobject(九)布局容器之Button篇——Gtk.ToggleButton
- PyGobject(十一)布局容器之Button篇——Gtk.RadioButton
- PyGobject(十二)布局容器之Button篇——Gtk.MenuButton
- PyGobject(十四)布局容器之Button篇——Gtk.LockButton
- PyGobject(十五)布局容器之Button篇——Gtk.ScaleButton
- PyGobject(十六)布局容器之Button篇——Gtk.VolumeButton
- PyGobject(十七)布局容器之Button篇——Gtk.ModelButton
- PyGobject(十三)布局容器之Button篇——图片按钮和圆形按钮
- PyGobject(二十)布局容器之ComboBox
- PyGobject(十八)布局容器之ActionBar
- PyGobject(十九)布局容器之Alignment
- PyGobject(三十)布局容器之StackSidebar
- PyGobject(三十一)布局容器之EventBox
- linux下C发送HttpPost请求
- 使用cmd命令运行带有jar(架包)的Java程序
- JConsole使用手册详解
- IO流删除带内容的目录
- rapidjson宏定义封装
- PyGobject(十)布局容器之Button篇——Gtk.CheckButton
- ubuntu14.04命令行直接安装jdk适合新手
- 走遍非洲 —— 埃及
- eclipse下新建hadoop项目
- Linux /proc/cpuinfo
- c语言socket编程(基础)
- Java 加密解密技术学习之BASE64
- controller中request变量的用法
- 控制流-(判断语句)