Class: MoveWin::Window

Inherits:
Object
  • Object
show all
Defined in:
lib/movewin.rb,
ext/movewin/movewin_ext.c

Instance Method Summary collapse

Instance Method Details

#app_nameObject

MoveWin::Window.app_name



50
# File 'ext/movewin/movewin_ext.c', line 50

VALUE MW_Window_app_name(VALUE self);

#boundsObject

Combined accessor and mutator for all window bounds together



57
58
59
# File 'lib/movewin.rb', line 57

def bounds
  self.position + self.size
end

#bounds=(*args) ⇒ Object Also known as: set_bounds!



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/movewin.rb', line 60

def bounds=(*args)
  x, y, width, height = args.flatten
  if x.nil? || y.nil?
    raise ArgumentError,
      'wrong number of arguments (2 coordinates required)'
  elsif width && height.nil?
    raise ArgumentError,
      'wrong number of arguments (height required if width specified)'
  end
  self.move!(x, y)
  self.resize!(width, height) if width && height
end

#heightObject



50
# File 'lib/movewin.rb', line 50

def height; self.size[1]; end

#height=(height) ⇒ Object



54
# File 'lib/movewin.rb', line 54

def height=(height); self.resize!(self[0], height); end

#move!Object

position=, move!



54
# File 'ext/movewin/movewin_ext.c', line 54

VALUE MW_Window_set_position(VALUE self, VALUE args);

#positionObject

MoveWin::Window.position



52
# File 'ext/movewin/movewin_ext.c', line 52

VALUE MW_Window_position(VALUE self);

#position=Object

position=, move!



54
# File 'ext/movewin/movewin_ext.c', line 54

VALUE MW_Window_set_position(VALUE self, VALUE args);

#resize!Object

size=, resize!



55
# File 'ext/movewin/movewin_ext.c', line 55

VALUE MW_Window_set_size(VALUE self, VALUE args);

#sizeObject

MoveWin::Window.size



53
# File 'ext/movewin/movewin_ext.c', line 53

VALUE MW_Window_size(VALUE self);

#size=Object

size=, resize!



55
# File 'ext/movewin/movewin_ext.c', line 55

VALUE MW_Window_set_size(VALUE self, VALUE args);

#titleObject

MoveWin::Window.title



51
# File 'ext/movewin/movewin_ext.c', line 51

VALUE MW_Window_title(VALUE self);

#to_sObject

MoveWin::Window.to_s



56
# File 'ext/movewin/movewin_ext.c', line 56

VALUE MW_Window_to_string(VALUE self);

#widthObject



49
# File 'lib/movewin.rb', line 49

def width;  self.size[0]; end

#width=(width) ⇒ Object



53
# File 'lib/movewin.rb', line 53

def width=(width);   self.resize!(width, self.size[1]);  end

#xObject

Individual accessors and mutators for window position and size components



47
# File 'lib/movewin.rb', line 47

def x; self.position[0]; end

#x=(x) ⇒ Object



51
# File 'lib/movewin.rb', line 51

def x=(x); self.move!(x, self.position[1]); end

#yObject



48
# File 'lib/movewin.rb', line 48

def y; self.position[1]; end

#y=(y) ⇒ Object



52
# File 'lib/movewin.rb', line 52

def y=(y); self.move!(self.position[0], y); end