Class: MoveWin::Window
- Inherits:
-
Object
- Object
- MoveWin::Window
- Defined in:
- lib/movewin.rb,
ext/movewin/movewin_ext.c
Instance Method Summary collapse
-
#app_name ⇒ Object
MoveWin::Window.app_name.
-
#bounds ⇒ Object
Combined accessor and mutator for all window bounds together.
- #bounds=(*args) ⇒ Object (also: #set_bounds!)
- #height ⇒ Object
- #height=(height) ⇒ Object
-
#move! ⇒ Object
position=, move!.
-
#position ⇒ Object
MoveWin::Window.position.
-
#position= ⇒ Object
position=, move!.
-
#resize! ⇒ Object
size=, resize!.
-
#size ⇒ Object
MoveWin::Window.size.
-
#size= ⇒ Object
size=, resize!.
-
#title ⇒ Object
MoveWin::Window.title.
-
#to_s ⇒ Object
MoveWin::Window.to_s.
- #width ⇒ Object
- #width=(width) ⇒ Object
-
#x ⇒ Object
Individual accessors and mutators for window position and size components.
- #x=(x) ⇒ Object
- #y ⇒ Object
- #y=(y) ⇒ Object
Instance Method Details
#app_name ⇒ Object
MoveWin::Window.app_name
50 |
# File 'ext/movewin/movewin_ext.c', line 50 VALUE MW_Window_app_name(VALUE self); |
#bounds ⇒ Object
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 |
#height ⇒ Object
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); |
#position ⇒ Object
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); |
#size ⇒ Object
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); |
#title ⇒ Object
MoveWin::Window.title
51 |
# File 'ext/movewin/movewin_ext.c', line 51 VALUE MW_Window_title(VALUE self); |
#to_s ⇒ Object
MoveWin::Window.to_s
56 |
# File 'ext/movewin/movewin_ext.c', line 56 VALUE MW_Window_to_string(VALUE self); |
#width ⇒ Object
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 |
#x ⇒ Object
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 |
#y ⇒ Object
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 |