当前位置: 首页>>代码示例>>Python>>正文


Python Gtk.HPaned方法代码示例

本文整理汇总了Python中gi.repository.Gtk.HPaned方法的典型用法代码示例。如果您正苦于以下问题:Python Gtk.HPaned方法的具体用法?Python Gtk.HPaned怎么用?Python Gtk.HPaned使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gi.repository.Gtk的用法示例。


在下文中一共展示了Gtk.HPaned方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import HPaned [as 别名]
def __init__(self, position, perspective):
        GObject.GObject.__init__(self, xscale=1, yscale=1)

        if position == NORTH or position == SOUTH:
            paned = Gtk.VPaned()
        elif position == EAST or position == WEST:
            paned = Gtk.HPaned()
        self.position = position
        self.perspective = perspective
        self.paned = paned
        self.add(self.paned)
        self.paned.show() 
开发者ID:pychess,项目名称:pychess,代码行数:14,代码来源:PyDockComposite.py

示例2: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import HPaned [as 别名]
def __init__(self, win):
        super(Worksheet, self).__init__()
        self.win = win
        self.app = win.app
        self.connection = None
        self.editor = Editor(self)
        self.editor_context = EditorContext(self)
        self.results = Results(self)

        sw = Gtk.ScrolledWindow()
        sw.add(self.editor)

        sw_context = Gtk.ScrolledWindow()
        sw_context.set_policy(
            Gtk.PolicyType.NEVER,
            Gtk.PolicyType.AUTOMATIC
        )
        sw_context.add(self.editor_context)

        self._context_paned = Gtk.HPaned()
        if self.app.args.experimental:
            self._context_paned.add1(sw_context)
        self._context_paned.add2(sw)
        self._context_paned.set_position(200)
        self.add1(self._context_paned)

        self.add2(self.results)

        self.connect('realize', self.on_map_event)
        self.connect('size-allocate', self.on_size_allocate)
        self.app.connection_manager.connect(
            'connection-deleted', self.on_connection_deleted) 
开发者ID:andialbrecht,项目名称:runsqlrun,代码行数:34,代码来源:__init__.py

示例3: ScrolledWindow

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import HPaned [as 别名]
def ScrolledWindow(widget, hpolicy=Gtk.PolicyType.AUTOMATIC, vpolicy=Gtk.PolicyType.AUTOMATIC, shadow=Gtk.ShadowType.IN):
	'''Wrap C{widget} in a C{Gtk.ScrolledWindow} and return the resulting
	widget
	@param widget: any Gtk widget
	@param hpolicy: the horizontal scrollbar policy
	@param vpolicy: the vertical scrollbar policy
	@param shadow: the shadow type
	@returns: a C{Gtk.ScrolledWindow}
	'''
	window = Gtk.ScrolledWindow()
	window.set_policy(hpolicy, vpolicy)
	window.set_shadow_type(shadow)

	if isinstance(widget, (Gtk.TextView, Gtk.TreeView, Gtk.Layout)):
		# Known native-scrolling widgets
		window.add(widget)
	else:
		window.add_with_viewport(widget)

	if hpolicy == Gtk.PolicyType.NEVER:
		hsize = -1 # do not set
	else:
		hsize = 24

	if vpolicy == Gtk.PolicyType.NEVER:
		vsize = -1 # do not set
	else:
		vsize = 24

	window.set_size_request(hsize, vsize)
		# scrolled widgets have at least this size...
		# by setting this minimum widgets can not "disappear" when
		# HPaned or VPaned bar is pulled all the way
	return window 
开发者ID:zim-desktop-wiki,项目名称:zim-desktop-wiki,代码行数:36,代码来源:widgets.py


注:本文中的gi.repository.Gtk.HPaned方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。