rcurses 0.5 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4be6bbd862ebe379d1e9863e1e33eb2672263ea0ded8eb2585a02850cf6f2a2c
4
- data.tar.gz: e4d7e0b5146611dd8617f99ed38544b901d98e6abc68889e74d49735a1902a44
3
+ metadata.gz: 86231e40ce6962a00b87ed4c836f8b551bd5b80d824ca4e231e3521355c9dbee
4
+ data.tar.gz: 471d5dd74bcc3a4cee73deaa618866d538f82ad47bd3b3f8228459f92d1bfafa
5
5
  SHA512:
6
- metadata.gz: 2b9f1580d0b71321888a721778a2e12d1e82f1449300e9fc3dd9b7129a562ba1c0d01ff7baf967dc550f074fddac409da9ed0fa605e51e9a531bd4359f35edee
7
- data.tar.gz: b2dfd7a266694130a1f927acb2cf951dd28c8ea4ba50a497eac146440e2ba2c5ed9e8c51843a35e35194f448c8ef1b334ed99d644c9283c2369a7cf54f82f3d4
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 "@maxrow/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 @maxrow for terminal height and @maxcol for terminal width.
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("@maxcol/2", 30, 30, 10, 19, 229)
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
@@ -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,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcurses
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-20 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Create panes (with the colors and(or border), manipulate the panes and
14
14
  add content. Dress up text (in panes or anywhere in the terminal) in bold, italic,
15
15
  underline, reverse color, blink and in any 256 terminal colors for foreground and
16
16
  background. Use a simple editor to let users edit text in panes. Left, right or
17
- center align text in panes. Cursor movement around the terminal. New in 0.5: Fixed
18
- artifact characters from rapid typing in edit mode.'
17
+ center align text in panes. Cursor movement around the terminal. New in 0.6: Better
18
+ edit function.'
19
19
  email: g@isene.com
20
20
  executables: []
21
21
  extensions:
@@ -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