Class: Gdk::Cursor

Inherits:
Object
  • Object
show all
Extended by:
GLib::Deprecatable
Defined in:
lib/gdk3/cursor.rb,
lib/gdk3/deprecated.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Cursor

Returns a new instance of Cursor.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/gdk3/cursor.rb', line 33

def initialize(*args)
  if args.last.is_a?(Hash)
    options = args.pop
  else
    options = {}
  end
  display = options[:display] || Display.default

  if args.size == 1 and args[0].is_a?(String)
    initialize_new_from_name(display, *args)
  else
    initialize_raw(display, *args)
  end
end

Class Method Details

.new(*args) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/gdk3/cursor.rb', line 21

def new(*args)
  first_arg = args.first
  case first_arg
  when String, Symbol, CursorType
    @caches[first_arg] ||= super
  else
    super
  end
end

Instance Method Details

#initialize_rawObject



32
# File 'lib/gdk3/cursor.rb', line 32

alias_method :initialize_raw, :initialize