rubytext 0.0.89 → 0.0.90
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/examples/{prog08.rb → brack_equal.rb} +3 -8
- data/examples/{prog09.rb → brackets.rb} +0 -0
- data/examples/{prog19.rb → center_meth.rb} +0 -0
- data/examples/{prog12.rb → detect_rc.rb} +0 -0
- data/examples/duh +26 -0
- data/examples/{prog20a.rb → effects.rb} +0 -0
- data/examples/fixme.rb +16 -0
- data/examples/{prog13.rb → go_meth.rb} +0 -0
- data/examples/{prog11.rb → hmmm.rb} +0 -0
- data/examples/{prog15.rb → home_udlr.rb} +0 -0
- data/examples/ide.rb +1 -1
- data/examples/{prog03.rb → no_border.rb} +0 -0
- data/examples/{prog04.rb → no_scroll.rb} +1 -1
- data/examples/{prog02.rb → output_meth.rb} +0 -0
- data/examples/{prog24.rb → putch.rb} +0 -0
- data/examples/{prog06.rb → puts_print.rb} +0 -0
- data/examples/{prog14.rb → rcprint.rb} +0 -0
- data/examples/{prog21.rb → simple_menu.rb} +1 -1
- data/examples/{prog01.rb → simple_win.rb} +0 -0
- data/examples/slides +28 -27
- data/examples/{prog07.rb → stdout_etc.rb} +0 -0
- data/examples/{prog10.rb → stdscr.rb} +0 -0
- data/examples/{prog23.rb → sym_navigate.rb} +0 -0
- data/examples/{prog22.rb → ticker_threads.rb} +0 -0
- data/examples/{prog18.rb → topbottom.rb} +0 -0
- data/examples/{prog17.rb → udlr_bang.rb} +0 -0
- data/examples/{prog16.rb → updown_etc.rb} +0 -0
- data/examples/{prog25.rb → win_centering.rb} +0 -0
- data/examples/{prog05.rb → window_full.rb} +0 -0
- data/lib/color.rb +2 -7
- data/lib/effects.rb +1 -3
- data/lib/menu.rb +49 -50
- data/lib/navigation.rb +2 -2
- data/lib/output.rb +7 -21
- data/lib/rubytext.rb +3 -1
- data/lib/settings.rb +3 -2
- data/lib/version.rb +1 -1
- data/lib/window.rb +1 -1
- metadata +29 -28
- data/examples/prog20.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 421ecdc77007b4ff06944a75582f99576d0600a535286241d3bfa6e7e22f9880
|
4
|
+
data.tar.gz: ee7e7d097b20c55accceb97cc86b9a7ec9c461e9a96c32478d2faecf9c841e9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd36f540b28317f4c7d745033d043f9a906371b95a9add8609a1affbf285b8f6f99c78f39db2c4db4967a494e64741c0a3b1a0abb390e3a037484e549e403447
|
7
|
+
data.tar.gz: 07fd65a3d3fa0ce4ba9ef77ab5904c19f07fe7a710ee0b05db2c038803e6ed9e581ce9fd11cd0f66cc87be3f258ab3de9c074d16842fb444af847f31af9c6318
|
data/README.md
CHANGED
@@ -4,11 +4,6 @@ win.puts "We can use the []= method (0-based)"
|
|
4
4
|
win.puts "to address individual window locations"
|
5
5
|
win.puts "and place characters there.\n "
|
6
6
|
|
7
|
-
sleep
|
8
|
-
win[
|
9
|
-
|
10
|
-
sleep 2
|
11
|
-
win[8,20] = "y"; win.refresh
|
12
|
-
|
13
|
-
sleep 2
|
14
|
-
win[6,38] = "Z"; win.refresh
|
7
|
+
sleep 1; win[4,22] = "X"; win.refresh
|
8
|
+
sleep 1; win[8,20] = "y"; win.refresh
|
9
|
+
sleep 1; win[6,38] = "Z"; win.refresh
|
File without changes
|
File without changes
|
File without changes
|
data/examples/duh
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
brack_equal.rb
|
2
|
+
simple_menu.rb
|
3
|
+
win_centering.rb
|
4
|
+
putch.rb
|
5
|
+
sym_navigate.rb
|
6
|
+
effects2.rb
|
7
|
+
effects.rb
|
8
|
+
center_meth.rb
|
9
|
+
topbottom.rb
|
10
|
+
udlr_bang.rb
|
11
|
+
updown_etc.rb
|
12
|
+
home_etc.rb
|
13
|
+
rcprint.rb
|
14
|
+
go_meth.rb
|
15
|
+
detect_rc.rb
|
16
|
+
hmmm.rb
|
17
|
+
stdscr.rb
|
18
|
+
brackets.rb
|
19
|
+
stdout_etc.rb
|
20
|
+
puts_print.rb
|
21
|
+
window_full.rb
|
22
|
+
no_scroll.rb
|
23
|
+
no_border.rb
|
24
|
+
output_meth.rb
|
25
|
+
simple_win.rb
|
26
|
+
ticker_threads.rb
|
File without changes
|
data/examples/fixme.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
files = Dir["**"].select {|x| x =~ /prog.*rb/ }
|
3
|
+
|
4
|
+
files.each do |file|
|
5
|
+
system "tput clear"
|
6
|
+
system "head -n 20 #{file}"
|
7
|
+
puts "\n\n "
|
8
|
+
print "New name = "
|
9
|
+
name = gets.chomp
|
10
|
+
break if name.empty?
|
11
|
+
str = "mv #{file} #{name}.rb"
|
12
|
+
puts str
|
13
|
+
system str
|
14
|
+
puts "\nEnter to continue..."
|
15
|
+
gets
|
16
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
data/examples/ide.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/examples/slides
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
def showme(name, up="", mode="pause")
|
4
|
+
system("ruby showme.rb #{name}.rb #{mode} #{up}")
|
5
|
+
end
|
6
|
+
|
3
7
|
mylib = `gem which rubytext`.chomp
|
4
8
|
examples = mylib.sub(%r[/lib/rubytext.rb], "/examples")
|
5
9
|
|
@@ -8,32 +12,29 @@ Dir.chdir(examples)
|
|
8
12
|
rc = system("ruby check.rb")
|
9
13
|
exit unless rc
|
10
14
|
|
11
|
-
# FIXME later:
|
12
|
-
# - use names instead of numbers?
|
13
|
-
# - convert showme into a method?
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
16
|
+
showme("simple_win")
|
17
|
+
showme("stdscr")
|
18
|
+
showme("stdout_etc")
|
19
|
+
showme("detect_rc")
|
20
|
+
showme("brackets")
|
21
|
+
showme("brack_equal")
|
22
|
+
showme("puts_print")
|
23
|
+
showme("output_meth")
|
24
|
+
showme("win_centering")
|
25
|
+
showme("putch")
|
26
|
+
showme("sym_navigate")
|
27
|
+
showme("effects")
|
28
|
+
showme("center_meth")
|
29
|
+
showme("topbottom")
|
30
|
+
showme("udlr_bang")
|
31
|
+
showme("updown_etc")
|
32
|
+
showme("home_udlr")
|
33
|
+
showme("rcprint")
|
34
|
+
showme("go_meth")
|
35
|
+
showme("no_border")
|
36
|
+
showme("no_scroll")
|
37
|
+
showme("window_full")
|
38
|
+
showme("ticker_threads", 11)
|
39
|
+
showme("simple_menu")
|
39
40
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/color.rb
CHANGED
@@ -6,7 +6,7 @@ Black, Blue, Cyan, Green, Magenta, Red, White, Yellow =
|
|
6
6
|
Colors = [Black, Blue, Cyan, Green, Magenta, Red, White, Yellow]
|
7
7
|
|
8
8
|
class RubyText::Color
|
9
|
-
Colors =
|
9
|
+
Colors = ::Colors
|
10
10
|
|
11
11
|
def self.sym2const(color) # to curses constant
|
12
12
|
X.const_get("COLOR_#{color.to_s.upcase}")
|
@@ -17,8 +17,7 @@ class RubyText::Color
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.pair(fg, bg)
|
20
|
-
nf = index(fg)
|
21
|
-
nb = index(bg)
|
20
|
+
nf, nb = index(fg), index(bg)
|
22
21
|
num = 8*nf + nb
|
23
22
|
X.init_pair(num, sym2const(fg), sym2const(bg))
|
24
23
|
num
|
@@ -27,9 +26,6 @@ end
|
|
27
26
|
|
28
27
|
class RubyText::Window
|
29
28
|
def self.colorize!(cwin, fg, bg)
|
30
|
-
File.open("/tmp/cize.out", "w") do |f|
|
31
|
-
f.puts "colorize: fg, bg = #{[fg, bg].inspect}"
|
32
|
-
end
|
33
29
|
cp = RubyText::Color.pair(fg, bg)
|
34
30
|
cwin.color_set(cp)
|
35
31
|
num = cwin.maxx * cwin.maxy
|
@@ -37,7 +33,6 @@ class RubyText::Window
|
|
37
33
|
cwin.addstr(' '*num)
|
38
34
|
cwin.setpos 0,0
|
39
35
|
cwin.refresh
|
40
|
-
debug "returning from colorize! call"
|
41
36
|
rescue => err
|
42
37
|
File.open("/tmp/#{__method__}.out", "w") do |f|
|
43
38
|
f.puts err
|
data/lib/effects.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
|
2
|
-
|
3
2
|
def fx(str, *args, bg: nil)
|
4
3
|
eff = RubyText::Effects.new(*args, bg: bg)
|
5
4
|
str.define_singleton_method(:effect) { eff }
|
@@ -45,7 +44,6 @@ class RubyText::Effects # dumb name?
|
|
45
44
|
def reset(win)
|
46
45
|
attr = self.value
|
47
46
|
win.cwin.attroff(attr)
|
48
|
-
win.set_colors(@old_fg, @old_bg)
|
47
|
+
win.set_colors(@old_fg, @old_bg) # Does restore logic work?
|
49
48
|
end
|
50
49
|
end
|
51
|
-
|
data/lib/menu.rb
CHANGED
@@ -1,58 +1,59 @@
|
|
1
1
|
module RubyText
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
class Window
|
4
|
+
def menu(r: :center, c: :center, items:, curr: 0,
|
5
|
+
title: nil, fg: White, bg: Blue)
|
6
|
+
RubyText.hide_cursor
|
7
|
+
high = items.size + 2
|
8
|
+
wide = items.map(&:length).max + 5
|
9
|
+
tlen = title.length + 8 rescue 0
|
10
|
+
wide = [wide, tlen].max
|
11
|
+
row, col = self.coords(r, c)
|
12
|
+
row = row - high/2 if r == :center
|
13
|
+
col = col - wide/2 if c == :center
|
14
|
+
r, c = row, col
|
15
|
+
self.saveback(high, wide, r, c)
|
16
|
+
mr, mc = r+self.r0, c+self.c0
|
17
|
+
mwin = RubyText.window(high, wide, r: mr, c: mc,
|
18
|
+
fg: fg, bg: bg)
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
where = self == STDSCR ? [r, c+1] : [r-1, c+1] # wtf?
|
21
|
+
unless title.nil?
|
22
|
+
self.go(*where) do # same row as corner but farther right
|
23
|
+
self.print fx("[ #{title} ]", :bold, fg, bg: bg)
|
24
|
+
end
|
23
25
|
end
|
24
|
-
end
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
27
|
+
X.stdscr.keypad(true)
|
28
|
+
sel = curr
|
29
|
+
max = items.size - 1
|
30
|
+
loop do
|
31
|
+
RubyText.hide_cursor # FIXME should be unnecessary
|
32
|
+
items.each.with_index do |item, row|
|
33
|
+
mwin.go row, 0
|
34
|
+
style = (sel == row) ? :reverse : :normal
|
35
|
+
label = (" "*2 + item + " "*8)[0..wide-1]
|
36
|
+
mwin.print fx(label, style)
|
37
|
+
end
|
38
|
+
ch = getch
|
39
|
+
case ch
|
40
|
+
when X::KEY_UP
|
41
|
+
sel -= 1 if sel > 0
|
42
|
+
when X::KEY_DOWN
|
43
|
+
sel += 1 if sel < max
|
44
|
+
when 27
|
45
|
+
self.restback(high, wide, r, c)
|
46
|
+
RubyText.show_cursor
|
47
|
+
return [nil, nil]
|
48
|
+
when 10
|
49
|
+
self.restback(high, wide, r, c)
|
50
|
+
RubyText.show_cursor
|
51
|
+
return [sel, items[sel]]
|
52
|
+
end
|
53
|
+
RubyText.show_cursor
|
38
54
|
end
|
39
|
-
ch = getch
|
40
|
-
case ch
|
41
|
-
when X::KEY_UP
|
42
|
-
sel -= 1 if sel > 0
|
43
|
-
when X::KEY_DOWN
|
44
|
-
sel += 1 if sel < max
|
45
|
-
when 27
|
46
|
-
win.restback(high, wide, r, c)
|
47
|
-
RubyText.show_cursor
|
48
|
-
return [nil, nil]
|
49
|
-
when 10
|
50
|
-
win.restback(high, wide, r, c)
|
51
|
-
RubyText.show_cursor
|
52
|
-
return [sel, items[sel]]
|
53
|
-
end
|
54
|
-
RubyText.show_cursor
|
55
55
|
end
|
56
|
+
|
56
57
|
end
|
57
58
|
|
58
59
|
def self.selector(win: STDSCR, r: 0, c: 0, rows: 10, cols: 20,
|
@@ -64,8 +65,6 @@ module RubyText
|
|
64
65
|
handler = callback
|
65
66
|
X.stdscr.keypad(true)
|
66
67
|
RubyText.hide_cursor
|
67
|
-
norm = RubyText::Effects.new(:normal)
|
68
|
-
rev = RubyText::Effects.new(:reverse)
|
69
68
|
sel = 0
|
70
69
|
max = items.size - 1
|
71
70
|
handler.call(sel, items[sel], win2)
|
data/lib/navigation.rb
CHANGED
data/lib/output.rb
CHANGED
@@ -19,25 +19,18 @@ class RubyText::Window
|
|
19
19
|
args = [""] if args.empty?
|
20
20
|
args += ["\n"] if sym == :puts
|
21
21
|
set_colors(@fg, @bg)
|
22
|
-
|
23
|
-
|
24
|
-
args.map! {|x| effect?(x) ? x : x.inspect }
|
25
|
-
else
|
26
|
-
args.map! {|x| effect?(x) ? x : x.to_s }
|
27
|
-
end
|
22
|
+
meth = sym == :p ? :inspect : :to_s
|
23
|
+
args.map! {|x| effect?(x) ? x : x.send(meth) }
|
28
24
|
args.each do |arg|
|
29
25
|
if arg.is_a?(RubyText::Effects)
|
30
26
|
arg.set(self)
|
31
|
-
elsif arg.respond_to? :effect
|
32
|
-
arg.effect.set(self)
|
33
|
-
arg.each_char {|ch| ch == "\n" ? crlf : @cwin.addch(ch) }
|
34
|
-
@cwin.refresh
|
35
27
|
else
|
28
|
+
arg.effect.set(self) if arg.respond_to? :effect
|
36
29
|
arg.each_char {|ch| ch == "\n" ? crlf : @cwin.addch(ch) }
|
37
30
|
@cwin.refresh
|
38
31
|
end
|
39
32
|
end
|
40
|
-
crlf if sym == :p
|
33
|
+
crlf if sym == :p # no implicit newline
|
41
34
|
set_colors(@fg, @bg)
|
42
35
|
@cwin.refresh
|
43
36
|
end
|
@@ -79,7 +72,6 @@ class RubyText::Window
|
|
79
72
|
fx.set(self) if fx
|
80
73
|
val = fx.value rescue 0
|
81
74
|
@cwin.addch(ch.ord|val)
|
82
|
-
# @cwin.addch(ch)
|
83
75
|
end
|
84
76
|
fx.reset(self) if fx
|
85
77
|
end
|
@@ -104,7 +96,7 @@ class RubyText::Window
|
|
104
96
|
end
|
105
97
|
end
|
106
98
|
|
107
|
-
def self.clear(win)
|
99
|
+
def self.clear(win) # delete this?
|
108
100
|
num = win.maxx * win.maxy
|
109
101
|
win.setpos(0, 0)
|
110
102
|
win.addstr(' '*num)
|
@@ -113,11 +105,8 @@ class RubyText::Window
|
|
113
105
|
end
|
114
106
|
|
115
107
|
def clear
|
116
|
-
num = self.rows * self.cols
|
117
108
|
self.home
|
118
|
-
self.
|
119
|
-
self.home
|
120
|
-
@cwin.refresh
|
109
|
+
self.scroll self.rows
|
121
110
|
end
|
122
111
|
|
123
112
|
def output(&block)
|
@@ -136,6 +125,7 @@ class RubyText::Window
|
|
136
125
|
def []=(r, c, char)
|
137
126
|
@cwin.setpos(r, c)
|
138
127
|
@cwin.addch(char[0].ord|X::A_NORMAL)
|
128
|
+
@cwin.setpos(r, c)
|
139
129
|
@cwin.refresh
|
140
130
|
end
|
141
131
|
|
@@ -155,7 +145,6 @@ class RubyText::Window
|
|
155
145
|
r0, c0 = self.rc
|
156
146
|
loop do
|
157
147
|
ch = self.getch
|
158
|
-
debug "gets: found #{ch.inspect}; cursor at #{self.rc.inspect}"
|
159
148
|
case ch
|
160
149
|
when 10 # Enter
|
161
150
|
self.crlf
|
@@ -175,7 +164,6 @@ class RubyText::Window
|
|
175
164
|
i += 1
|
176
165
|
self.right
|
177
166
|
else
|
178
|
-
debug " case 3 (#{ch.inspect})"
|
179
167
|
str.insert(i, ch)
|
180
168
|
self.right
|
181
169
|
self.go(r0, c0) { self.print str }
|
@@ -187,8 +175,6 @@ class RubyText::Window
|
|
187
175
|
|
188
176
|
end
|
189
177
|
|
190
|
-
# into top level...
|
191
|
-
|
192
178
|
module WindowIO
|
193
179
|
def puts(*args) # Doesn't affect STDOUT.puts, etc.
|
194
180
|
recv = RubyText.started ? $stdscr : Kernel
|
data/lib/rubytext.rb
CHANGED
@@ -2,7 +2,7 @@ $LOAD_PATH << "lib"
|
|
2
2
|
|
3
3
|
require 'curses'
|
4
4
|
|
5
|
-
X = Curses # shorthand
|
5
|
+
X = Curses # shorthand. klunky I know
|
6
6
|
|
7
7
|
module RubyText
|
8
8
|
end
|
@@ -33,6 +33,8 @@ end
|
|
33
33
|
|
34
34
|
at_exit { RubyText.stop }
|
35
35
|
|
36
|
+
# FIXME lots of changes to make here...
|
37
|
+
|
36
38
|
def import(meth, recv)
|
37
39
|
Kernel.module_eval do
|
38
40
|
define_method(meth) {|*args| recv.send(meth, *args) }
|
data/lib/settings.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module RubyText
|
2
|
-
# Hmm, all these are module-level
|
2
|
+
# Hmm, all these are module-level...?
|
3
3
|
|
4
|
-
ValidArgs = [:raw, :_raw, :echo, :_echo, :cbreak, :_cbreak,
|
4
|
+
ValidArgs = [:raw, :_raw, :echo, :_echo, :cbreak, :_cbreak,
|
5
|
+
:keypad, :_keypad, :cursor, :_cursor]
|
5
6
|
|
6
7
|
def self.started
|
7
8
|
@started
|
data/lib/version.rb
CHANGED
data/lib/window.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubytext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.90
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -41,39 +41,40 @@ files:
|
|
41
41
|
- "./rubytext.gemspec"
|
42
42
|
- bin/rubytext
|
43
43
|
- examples/README
|
44
|
+
- examples/brack_equal.rb
|
45
|
+
- examples/brackets.rb
|
46
|
+
- examples/center_meth.rb
|
44
47
|
- examples/check.rb
|
45
48
|
- examples/crap.rb
|
46
49
|
- examples/demo.rb
|
50
|
+
- examples/detect_rc.rb
|
51
|
+
- examples/duh
|
52
|
+
- examples/effects.rb
|
53
|
+
- examples/fixme.rb
|
54
|
+
- examples/go_meth.rb
|
55
|
+
- examples/hmmm.rb
|
56
|
+
- examples/home_udlr.rb
|
47
57
|
- examples/ide.rb
|
48
58
|
- examples/multitest.rb
|
49
|
-
- examples/
|
50
|
-
- examples/
|
51
|
-
- examples/
|
52
|
-
- examples/
|
53
|
-
- examples/
|
54
|
-
- examples/
|
55
|
-
- examples/prog07.rb
|
56
|
-
- examples/prog08.rb
|
57
|
-
- examples/prog09.rb
|
58
|
-
- examples/prog10.rb
|
59
|
-
- examples/prog11.rb
|
60
|
-
- examples/prog12.rb
|
61
|
-
- examples/prog13.rb
|
62
|
-
- examples/prog14.rb
|
63
|
-
- examples/prog15.rb
|
64
|
-
- examples/prog16.rb
|
65
|
-
- examples/prog17.rb
|
66
|
-
- examples/prog18.rb
|
67
|
-
- examples/prog19.rb
|
68
|
-
- examples/prog20.rb
|
69
|
-
- examples/prog20a.rb
|
70
|
-
- examples/prog21.rb
|
71
|
-
- examples/prog22.rb
|
72
|
-
- examples/prog23.rb
|
73
|
-
- examples/prog24.rb
|
74
|
-
- examples/prog25.rb
|
59
|
+
- examples/no_border.rb
|
60
|
+
- examples/no_scroll.rb
|
61
|
+
- examples/output_meth.rb
|
62
|
+
- examples/putch.rb
|
63
|
+
- examples/puts_print.rb
|
64
|
+
- examples/rcprint.rb
|
75
65
|
- examples/showme.rb
|
66
|
+
- examples/simple_menu.rb
|
67
|
+
- examples/simple_win.rb
|
76
68
|
- examples/slides
|
69
|
+
- examples/stdout_etc.rb
|
70
|
+
- examples/stdscr.rb
|
71
|
+
- examples/sym_navigate.rb
|
72
|
+
- examples/ticker_threads.rb
|
73
|
+
- examples/topbottom.rb
|
74
|
+
- examples/udlr_bang.rb
|
75
|
+
- examples/updown_etc.rb
|
76
|
+
- examples/win_centering.rb
|
77
|
+
- examples/window_full.rb
|
77
78
|
- lib/color.rb
|
78
79
|
- lib/effects.rb
|
79
80
|
- lib/keys.rb
|
data/examples/prog20.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
def effect(*args) # find better way
|
2
|
-
RubyText::Effects.new(*args)
|
3
|
-
end
|
4
|
-
|
5
|
-
fg, bg = White, Blue
|
6
|
-
win = RubyText.window(9, 65, r: 2, c: 26, fg: fg, bg: bg)
|
7
|
-
|
8
|
-
win.puts "This is EXPERIMENTAL (and BUGGY)."
|
9
|
-
win.puts "Use an \"effect\" to change the text color or \"look\":"
|
10
|
-
|
11
|
-
win.puts "This is", effect(Yellow), " another color ",
|
12
|
-
effect(White), "and yet another."
|
13
|
-
win.puts "We can ", effect(:bold), "boldface ",
|
14
|
-
"and ", effect(:reverse), "reverse ",
|
15
|
-
"and ", effect(:under), "underline ",
|
16
|
-
effect(:normal), "text at will.\n "
|
17
|
-
win.puts "This is ", effect(:bold, Red), "bold red ",
|
18
|
-
effect(:normal, fg), "and this is normal again.\n "
|