Class: Gtk::SelectionData

Inherits:
Object
  • Object
show all
Extended by:
GLib::Deprecatable
Defined in:
lib/gtk3/deprecated.rb,
lib/gtk3/selection-data.rb

Instance Method Summary collapse

Instance Method Details

#set(type, data, options = {}) ⇒ Object


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/gtk3/selection-data.rb', line 20

def set(type, data, options={})
  format ||= options[:format]
  if format.nil?
    case type
    when Gdk::Selection::TYPE_INTEGER
      format = 32
    when Gdk::Selection::TYPE_STRING
      format = 8
    else
      message = "specify :format as the number of bits of each data"
      raise ArgumentError, message
    end
  end
  set_raw(type, format, data)
end

#set_rawObject


19
# File 'lib/gtk3/selection-data.rb', line 19

alias_method :set_raw, :set

#set_text(text) ⇒ Object Also known as: text=


37
38
39
# File 'lib/gtk3/selection-data.rb', line 37

def set_text(text)
  set_text_raw(text, text.bytesize)
end

#set_text_rawObject


36
# File 'lib/gtk3/selection-data.rb', line 36

alias_method :set_text_raw, :set_text