Class: Wx::Rect

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/classes/rect.rb

Overview

Class representing a rectangular shape

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object

Correct comparison for Wx::Rect, are the same if have the same position and the same size



10
11
12
13
14
15
16
# File 'lib/wx/classes/rect.rb', line 10

def ==(other)
  unless other.kind_of?(Wx::Rect)
    Kernel.raise TypeError, "Cannot compare Rect to #{other}"
  end
  get_left == other.get_left and get_top == other.get_top and
    get_right = other.get_right and get_bottom == other.get_bottom
end

#to_sObject

Nicely readable inspect output for Rect



4
5
6
# File 'lib/wx/classes/rect.rb', line 4

def to_s
  "#<Wx::Rect: (#{get_left}, #{get_top}) (#{get_right}, #{get_bottom})>"    
end