Class: Curses::Window

Inherits:
Object
  • Object
show all
Defined in:
lib/cursesx.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#__children__Object (readonly) Also known as: children

Returns the value of attribute __children__.



95
96
97
# File 'lib/cursesx.rb', line 95

def __children__
  @__children__
end

#__parent__Object Also known as: parent

Returns the value of attribute __parent__.



96
97
98
# File 'lib/cursesx.rb', line 96

def __parent__
  @__parent__
end

Instance Method Details

#color(name) ⇒ Object



163
# File 'lib/cursesx.rb', line 163

def color(name); Curses.color(name); end

#drawObject

Draw the window.



161
# File 'lib/cursesx.rb', line 161

def draw; warning "Not implemented"; end

#echoObject

Echo within the block.



137
138
139
140
141
142
143
144
145
146
# File 'lib/cursesx.rb', line 137

def echo
  if block_given?
    Curses.echo
    res = yield
    Curses.noecho
    return res
  else
    Curses.echo
  end
end

#noechoObject

Noecho within the block.



149
150
151
152
153
154
155
156
157
158
# File 'lib/cursesx.rb', line 149

def noecho
  if block_given?
    Curses.noecho
    res = yield
    Curses.echo
    return res
  else
    Curses.noecho
  end
end

#standendObject

Standend within the block.



126
127
128
129
130
131
132
133
134
# File 'lib/cursesx.rb', line 126

def standend
  if block_given?
    standend_orig
    yield
    standout_orig
  else
    standend_orig
  end
end

#standend_origObject



112
# File 'lib/cursesx.rb', line 112

alias :standend_orig :standend

#standoutObject

Standout within the block.



115
116
117
118
119
120
121
122
123
# File 'lib/cursesx.rb', line 115

def standout
  if block_given?
    standout_orig
    yield
    standend_orig
  else
    standout_orig
  end
end

#standout_origObject



111
# File 'lib/cursesx.rb', line 111

alias :standout_orig :standout

#subwin(height, width, y, x, mod = nil) ⇒ Object



102
103
104
105
106
107
108
109
# File 'lib/cursesx.rb', line 102

def subwin(height, width, y, x, mod = nil)
  @__children__ ||= []
  win = subwin_orig(height, width, y, x)
  win.parent = self
  win.extend mod if mod
  @__children__ << win
  return win
end

#subwin_origObject



101
# File 'lib/cursesx.rb', line 101

alias :subwin_orig :subwin