本文整理汇总了Python中higwidgets.higbuttons.HIGButton.drag_source_set方法的典型用法代码示例。如果您正苦于以下问题:Python HIGButton.drag_source_set方法的具体用法?Python HIGButton.drag_source_set怎么用?Python HIGButton.drag_source_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类higwidgets.higbuttons.HIGButton
的用法示例。
在下文中一共展示了HIGButton.drag_source_set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ToolDesign
# 需要导入模块: from higwidgets.higbuttons import HIGButton [as 别名]
# 或者: from higwidgets.higbuttons.HIGButton import drag_source_set [as 别名]
class ToolDesign(HIGScrolledWindow):
'''
ToolDesign contains widgets that you can add to Notebook to edit Profile
and Wizard
'''
def __init__(self, only_text=True):
HIGScrolledWindow.__init__(self)
self._box = HIGVBox()
vp = gtk.Viewport()
self._box.set_border_width(6)
if only_text:
self._draw_buttons()
self._pack()
#ELSE == Algo com icons; ETC!
vp.add(self._box)
vp.set_shadow_type(gtk.SHADOW_NONE)
self.add(vp)
def update_toolbar(self):
pass
def _draw_buttons(self):
self.button_list = HIGButton('Option List')
img = gtk.Image()
img_dir = os.path.join(pixmaps_dir, 'uie', 'combo.png')
img.set_from_file(img_dir)
self.button_list.set_image(img)
self.button_list.drag_source_set(gtk.gdk.BUTTON1_MASK ,
target, gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
self.button_list.connect('drag_data_get', self._drag_option_list)
self.button_label = HIGButton('Label')
img = gtk.Image()
img_dir = os.path.join(pixmaps_dir,'uie', 'label.png')
img.set_from_file(img_dir)
self.button_label.set_image(img)
self.button_label.drag_source_set(gtk.gdk.BUTTON1_MASK ,
target, gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
self.button_label.connect('drag_data_get', self.source_drag_data_get)
self.button_check = HIGButton('Option Check')
img = gtk.Image()
img_dir = os.path.join(pixmaps_dir, 'uie', 'checkbutton.png')
img.set_from_file(img_dir)
self.button_check.set_image(img)
self.button_path = HIGButton('Choose Path')
self.button_text_entry = HIGButton('String')
img = gtk.Image()
img_dir = os.path.join(pixmaps_dir,'uie', 'entry.png')
img.set_from_file(img_dir)
self.button_text_entry.set_image(img)
self.button_float = HIGButton('Float Spin')
img = gtk.Image()
img_dir = os.path.join(pixmaps_dir, 'uie', 'spinbutton.png')
img.set_from_file(img_dir)
self.button_float.set_image(img)
self.button_level = HIGButton('Level Spin')
img = gtk.Image()
img_dir = os.path.join(pixmaps_dir, 'uie', 'spinbutton.png')
img.set_from_file(img_dir)
self.button_level.set_image(img)
self.button_interface = HIGButton('Interface')
self.button_integer = HIGButton('Integer Spin ')
img = gtk.Image()
img_dir = os.path.join(pixmaps_dir, 'uie', 'spinbutton.png')
img.set_from_file(img_dir)
self.button_integer.set_image(img)
def source_drag_data_get(self, btn, context, selection_data, info, time):
selection_data.set(selection_data.target, 8, "Label")
def _drag_option_list(self, btn, context, selection_data, info, time):
selection_data.set(selection_data.target, 8, "_widget_option_list")
def _pack(self):
box = self._box
box.pack_start(self.button_list, False, False)
box.pack_start(self.button_label, False, False)