5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/DragDrop.rb', line 5
def add_target_widget(widget)
@target_widgets ||= []
@target_widgets << widget
ar = [[ self.object_id.to_s, :same_app, 12_345]]
drag_source_set(Gdk::ModifierType::BUTTON1_MASK |
Gdk::ModifierType::BUTTON2_MASK,
ar,
Gdk::DragAction::COPY |
Gdk::DragAction::MOVE)
widget.extend(VR::Droppable) unless widget.is_a?(VR::Droppable)
widget.add_source_widget(self)
self.signal_connect("drag_begin") do |widget, context|
@target_widgets.each { |widg| widg.dragged_widget = self }
end
end
|