rcurses 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/rcurses.rb +0 -0
- data/rcurses_example.rb +19 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86231e40ce6962a00b87ed4c836f8b551bd5b80d824ca4e231e3521355c9dbee
|
4
|
+
data.tar.gz: 471d5dd74bcc3a4cee73deaa618866d538f82ad47bd3b3f8228459f92d1bfafa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94e2f0cae89f5226bef82bd432e6d23b70896df328c494aade5c24d0bf76a21c1a39be82923896b923c550f379dc80d02b98f6d9522d89c03ba6bbb578ad7ed6
|
7
|
+
data.tar.gz: a83c417de46e063677693103fa2def178cb123d7918c64d1f0781fe301146c178993c3bb9f9d451bd6564380315dc9dcd2068ef9496677f41b8be1986e87929a
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ The format for creating a pane is:
|
|
44
44
|
```
|
45
45
|
Rcurses::Pane.new(startx, starty, width, height, foregroundcolor, backgroundcolor)
|
46
46
|
```
|
47
|
-
You can drop the last two 256-color codes to create a pane with the defaults for your terminal. Also, you can add anything as `startx`, `starty`, `width` or `height` as those values will be run through a Ruby eval and stored in readable variables `x`, `y`, `w` and `h` respectively. So, a hight value of "
|
47
|
+
You can drop the last two 256-color codes to create a pane with the defaults for your terminal. Also, you can add anything as `startx`, `starty`, `width` or `height` as those values will be run through a Ruby eval and stored in readable variables `x`, `y`, `w` and `h` respectively. So, a hight value of "Rcurses::MAXh/2" is valid to create a pane with the height of half the terminal height (the integer corresponding to half the terminal height will then be accessible as the variable `h`). Use the variables `Rcurses::MAXh` for terminal height and `Rcurses::MAXw` for terminal width.
|
48
48
|
|
49
49
|
Avaliable properties/variables:
|
50
50
|
|
@@ -196,7 +196,7 @@ end
|
|
196
196
|
Try this in `irb`:
|
197
197
|
```
|
198
198
|
require 'rcurses'
|
199
|
-
mypane = Pane.new(
|
199
|
+
mypane = Pane.new(Rcurses::MAXw/2, 30, 30, 10, 19, 229)
|
200
200
|
mypane.border = true
|
201
201
|
mypane.text = "Hello".i + " World!".b.i + "\n \n" + "rcurses".r + " " + "is cool".c("16,212")
|
202
202
|
mypane.refresh
|
@@ -204,6 +204,8 @@ mypane.edit
|
|
204
204
|
```
|
205
205
|
... and then try to add some bold text by enclosing it in '*' and italics by enclosing text in '/'. Then press 'ctrl-s' to save your edited text - and then type `mypane.refresh` to see the result.
|
206
206
|
|
207
|
+
And - try running the example file `rcurses_example.rb`.
|
208
|
+
|
207
209
|
# Not yet implemented
|
208
210
|
Let me know what other features you like to see.
|
209
211
|
|
data/lib/rcurses.rb
CHANGED
Binary file
|
data/rcurses_example.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rcurses'
|
4
|
+
|
5
|
+
# pane = Rcurses::Pane.new( startx, starty, width, height, fg, bg)
|
6
|
+
pane_top = Rcurses::Pane.new( 1, 1, Rcurses::MAXw, 1, 19, 236)
|
7
|
+
pane_bottom = Rcurses::Pane.new( 1, Rcurses::MAXh, Rcurses::MAXw, 1, 236, 254)
|
8
|
+
pane_left = Rcurses::Pane.new( 1, 1, Rcurses::MAXw/2, Rcurses::MAXh - 2, 17, 117)
|
9
|
+
pane_right = Rcurses::Pane.new(Rcurses::MAXw/2 + 1, 1, Rcurses::MAXw/2, Rcurses::MAXh - 2, 255, 52)
|
10
|
+
|
11
|
+
pane_top.text = "This is an information line at the top".b
|
12
|
+
pane_left.text = "\n\nHere is a pane to be reckoned with"
|
13
|
+
pane_right.text = "\n\nAnd here is the right pane"
|
14
|
+
pane_bottom.prompt = "Enter any text and press ENTER: ".i.b
|
15
|
+
|
16
|
+
pane_top.refresh
|
17
|
+
pane_left.refresh
|
18
|
+
pane_right.refresh
|
19
|
+
pane_bottom.editline
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcurses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- README.md
|
26
26
|
- extconf.rb
|
27
27
|
- lib/rcurses.rb
|
28
|
+
- rcurses_example.rb
|
28
29
|
homepage: https://isene.com/
|
29
30
|
licenses:
|
30
31
|
- Unlicense
|