本文整理汇总了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()
示例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)
示例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