Class: Glimmer::Tk::DragAndDropEvent

Inherits:
Struct
  • Object
show all
Defined in:
lib/glimmer/tk/drag_and_drop_event.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



3
4
5
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 3

def data
  @data
end

#drop_acceptedObject Also known as: drop_accepted?

Returns the value of attribute drop_accepted

Returns:

  • (Object)

    the current value of drop_accepted



3
4
5
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 3

def drop_accepted
  @drop_accepted
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



3
4
5
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 3

def source
  @source
end

#targetObject

Returns the value of attribute target

Returns:

  • (Object)

    the current value of target



3
4
5
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 3

def target
  @target
end

#tooltipObject

Returns the value of attribute tooltip

Returns:

  • (Object)

    the current value of tooltip



3
4
5
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 3

def tooltip
  @tooltip
end

#x_rootObject

Returns the value of attribute x_root

Returns:

  • (Object)

    the current value of x_root



3
4
5
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 3

def x_root
  @x_root
end

#y_rootObject

Returns the value of attribute y_root

Returns:

  • (Object)

    the current value of y_root



3
4
5
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 3

def y_root
  @y_root
end

Class Method Details

.json_create(object) ⇒ Object



18
19
20
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 18

def self.json_create(object)
  new(*[ObjectSpace._id2ref(object["v"][0]), ObjectSpace._id2ref(object["v"][1]).proxy, ObjectSpace._id2ref(object["v"][2])].concat(object["v"].drop 3))
end

Instance Method Details

#as_jsonObject



6
7
8
9
10
11
12
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 6

def as_json(*)
  klass = self.class.name
  {
    JSON.create_id => klass,
    "v" => [values[0].object_id, values[1].object_id, values[2].object_id].concat(values.drop 3),
  }
end

#to_json(*args) ⇒ Object



14
15
16
# File 'lib/glimmer/tk/drag_and_drop_event.rb', line 14

def to_json(*args)
  as_json.to_json(*args)
end