本文整理匯總了Python中etk.docking.DockGroup.do_drag_begin方法的典型用法代碼示例。如果您正苦於以下問題:Python DockGroup.do_drag_begin方法的具體用法?Python DockGroup.do_drag_begin怎麽用?Python DockGroup.do_drag_begin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類etk.docking.DockGroup
的用法示例。
在下文中一共展示了DockGroup.do_drag_begin方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_drag_drop_on_group
# 需要導入模塊: from etk.docking import DockGroup [as 別名]
# 或者: from etk.docking.DockGroup import do_drag_begin [as 別名]
def test_drag_drop_on_group(self):
win = gtk.Window(gtk.WINDOW_TOPLEVEL)
frame = DockFrame()
paned = DockPaned()
group = DockGroup()
item = DockItem()
layout = self.layout
layout.add(frame)
win.add(frame)
frame.add(paned)
paned.add(group)
group.add(item)
win.set_default_size(200, 200)
win.show_all()
while gtk.events_pending():
gtk.main_iteration()
context = StubContext(group, [group.items[0]])
group.do_drag_begin(context)
x, y = 30, 30
layout.on_widget_drag_motion(group, context, x, y, 0)
assert layout._drag_data
assert layout._drag_data.drop_widget is group
layout.on_widget_drag_drop(group, context, x, y, 0)