PyGobject(五十二)布局容器之Paned
2016-07-30 13:27
381 查看
GtkPaned
继承关系
Methods
Virtual Methods
Properties
Signals
例子
![](https://img-blog.csdn.net/20160730132308031)
![](https://img-blog.csdn.net/20160730132439113)
代码:
代码解析:
例子比较简单,略
代码下载地址:http://download.csdn.net/detail/a87b01c14/9594728
继承关系
Methods
Virtual Methods
Properties
Signals
例子
Gtk.Paned
Gtk.Paned分隔面板布局,有左右分隔和上下分隔两种。可拖动分隔线,来调整两个子孩子的大小继承关系
Gtk.Paned是Gtk.Container的直接子类Methods
方法修饰词 | 方法名及参数 |
---|---|
static | new (orientation) |
add1 (child) | |
add2 (child) | |
get_child1 () | |
get_child2 () | |
get_handle_window () | |
get_position () | |
get_wide_handle () | |
pack1 (child, resize, shrink) | |
pack2 (child, resize, shrink) | |
set_position (position) | |
set_wide_handle (wide) |
Virtual Methods
do_accept_position () |
do_cancel_position () |
do_cycle_child_focus (reverse) |
do_cycle_handle_focus (reverse) |
do_move_handle (scroll) |
do_toggle_handle_focus () |
Properties
Name | Type | Flags | Short Description |
---|---|---|---|
max-position | int | r/en | Largest possible value for the “position” property |
min-position | int | r/en | Smallest possible value for the “position” property |
position | int | r/w/en | Position of paned separator in pixels (0 means all the way to the left/top) |
position-set | bool | r/w/en | True if the Position property should be used |
wide-handle | bool | r/w/en | Whether the paned should have a prominent handle |
Signals
Name | Short Description |
---|---|
accept-position | The ::accept-position signal is a keybinding signal which gets emitted to accept the current position of the handle when moving it using key bindings. |
cancel-position | The ::cancel-position signal is a keybinding signal which gets emitted to cancel moving the position of the handle using key bindings. |
cycle-child-focus | The ::cycle-child-focus signal is a keybinding signal which gets emitted to cycle the focus between the children of the paned. |
cycle-handle-focus | The ::cycle-handle-focus signal is a keybinding signal which gets emitted to cycle whether the paned should grab focus to allow the user to change position of the handle by using key bindings. |
move-handle | The ::move-handle signal is a keybinding signal which gets emitted to move the handle when the user is using key bindings to move it. |
toggle-handle-focus | The ::toggle-handle-focus is a keybinding signal which gets emitted to accept the current position of the handle and then move focus to the next widget in the focus chain. |
例子
代码:
#!/usr/bin/env python3 # Created by xiaosanyu at 16/7/7 # section 069 TITLE = "Paned" DESCRIPTION = """ Gtk.Paned has two panes, arranged either horizontally or vertically. The division between the two panes is adjustable by the user by dragging a handle. """ import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk class PanedWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Paned Example") self.set_size_request(250, 200) hpaned = Gtk.Paned(orientation=Gtk.Orientation.HORIZONTAL) hpaned.add1(Gtk.Button("button1")) hpaned.add2(Gtk.Button("button2")) vpaned = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL) vpaned.add1(hpaned) vpaned.add2(Gtk.Button("button3")) self.add(vpaned) def main(): win = PanedWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() if __name__ == "__main__": main()
代码解析:
例子比较简单,略
代码下载地址:http://download.csdn.net/detail/a87b01c14/9594728
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python将excel导入到mysql中
- Python在CAM软件Genesis2000中的应用
- 使用Shiboken为C++和Qt库创建Python绑定
- FREEBASIC 编译可被python调用的dll函数示例
- Python 七步捉虫法