您的位置:首页 > 移动开发 > Objective-C

PyGobject(五十二)布局容器之Paned

2016-07-30 13:27 381 查看
GtkPaned
继承关系

Methods

Virtual Methods

Properties

Signals

例子

Gtk.Paned

Gtk.Paned分隔面板布局,有左右分隔和上下分隔两种。可拖动分隔线,来调整两个子孩子的大小

继承关系

Gtk.Paned是Gtk.Container的直接子类



Methods

方法修饰词方法名及参数
staticnew (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

NameTypeFlagsShort Description
max-positionintr/enLargest possible value for the “position” property
min-positionintr/enSmallest possible value for the “position” property
positionintr/w/enPosition of paned separator in pixels (0 means all the way to the left/top)
position-setboolr/w/enTrue if the Position property should be used
wide-handleboolr/w/enWhether the paned should have a prominent handle

Signals

NameShort Description
accept-positionThe ::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-positionThe ::cancel-position signal is a keybinding signal which gets emitted to cancel moving the position of the handle using key bindings.
cycle-child-focusThe ::cycle-child-focus signal is a keybinding signal which gets emitted to cycle the focus between the children of the paned.
cycle-handle-focusThe ::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-handleThe ::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-focusThe ::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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息