本文整理汇总了Python中etkdocking.DockGroup.set_name方法的典型用法代码示例。如果您正苦于以下问题:Python DockGroup.set_name方法的具体用法?Python DockGroup.set_name怎么用?Python DockGroup.set_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类etkdocking.DockGroup
的用法示例。
在下文中一共展示了DockGroup.set_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from etkdocking import DockGroup [as 别名]
# 或者: from etkdocking.DockGroup import set_name [as 别名]
def __init__(self, docklayout=None, dockframe=None):
gtk.Window.__init__(self)
self.set_default_size(500, 150)
self.set_title('etk.docking demo')
self.set_border_width(4)
self.file_counter = 1
self.subwindows = []
vbox = gtk.VBox()
vbox.set_spacing(4)
self.add(vbox)
########################################################################
# Docking
########################################################################
if docklayout and dockframe:
self.dockframe = dockframe
self.docklayout = docklayout
else:
self.dockframe = DockFrame()
self.dockframe.set_border_width(8)
g = DockGroup()
g.set_name('main')
self.dockframe.add(g)
self.docklayout = DockLayout()
self.docklayout.add(self.dockframe)
settings['main'].auto_remove = False
settings['main'].can_float = True
settings['main'].inherit_settings = False
settings['main'].expand = False
# To change default group behaviour:
# self.docklayout.settings[None].inherit_settings = False
vbox.pack_start(self.dockframe)
def on_item_closed(layout, group, item):
item.destroy()
print 'closed item:', item.title
self.docklayout.connect('item-closed', on_item_closed)
def on_item_selected(layout, group, item):
print 'Selected item:', item.title
self.docklayout.connect('item-selected', on_item_selected)
########################################################################
# Testing Tools
########################################################################
adddibutton = gtk.Button('Create docked items')
adddibutton.child.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
adddibutton.connect('clicked', self._on_add_di_button_clicked)
vbox.pack_start(adddibutton, False, False)
orientationbutton = gtk.Button('Switch Orientation')
orientationbutton.child.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
orientationbutton.connect('clicked', self._on_orientation_button_clicked)
vbox.pack_start(orientationbutton, False, False)
hbox = gtk.HBox()
savebutton = gtk.Button('Save layout')
savebutton.child.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
savebutton.connect('clicked', self._on_save_button_clicked)
hbox.pack_start(savebutton, True, True)
loadbutton = gtk.Button('Load layout')
loadbutton.child.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
loadbutton.connect('clicked', self._on_load_button_clicked)
hbox.pack_start(loadbutton, True, True)
vbox.pack_start(hbox, False, False)
self.show_all()