Parent

Class/Module Index [+]

Quicksearch

Rabbit::CursorManager

Attributes

current[RW]

Public Class Methods

new() click to toggle source
# File lib/rabbit/cursor-manager.rb, line 10
def initialize
  @stocks = {}
  @current = nil
  @blank_cursor = blank_cursor
  @pencil_cursor = Gdk::Cursor.new(Gdk::Cursor::PENCIL)
  @hand_cursor = Gdk::Cursor.new(Gdk::Cursor::HAND1)
end

Public Instance Methods

keep(name) click to toggle source
# File lib/rabbit/cursor-manager.rb, line 18
def keep(name)
  @stocks[name] ||= []
  @stocks[name].push(@current)
end
restore(drawable, name) click to toggle source
# File lib/rabbit/cursor-manager.rb, line 23
def restore(drawable, name)
  if name.nil?
    type = @current
  else
    type = @stocks[name].pop
  end
  drawable.cursor = type_to_cursor(type)
end
update(drawable, type) click to toggle source
# File lib/rabbit/cursor-manager.rb, line 32
def update(drawable, type)
  drawable.cursor = type_to_cursor(type)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.