rbcurse 1.1.5 → 1.2.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +45 -0
- data/Makefile +1 -1
- data/Manifest.txt +91 -0
- data/NOTES +349 -2
- data/README.markdown +12 -0
- data/VERSION +1 -1
- data/examples/abasiclist.rb +25 -0
- data/examples/alpmenu.rb +42 -0
- data/examples/app.rb +883 -0
- data/examples/appcombo.rb +17 -0
- data/examples/appdirtree.rb +73 -0
- data/examples/appemail.rb +164 -0
- data/examples/appemaillb.rb +308 -0
- data/examples/appgcompose.rb +303 -0
- data/examples/appgmail.rb +951 -0
- data/examples/atree.rb +56 -0
- data/examples/dirtree.rb +78 -0
- data/examples/focusmanager.rb +31 -0
- data/examples/imap.rb +48 -0
- data/examples/menu1.rb +79 -0
- data/examples/multispl.rb +86 -0
- data/examples/rfe.rb +3 -4
- data/examples/rmail.rb +188 -0
- data/examples/s.rb +10 -0
- data/examples/scrollbar.rb +104 -0
- data/examples/splitp.rb +56 -0
- data/examples/table1.rb +30 -0
- data/examples/term.rb +48 -0
- data/examples/term2.rb +54 -0
- data/examples/test1.rb +4 -2
- data/examples/test2.rb +9 -9
- data/examples/testapp.rb +44 -0
- data/examples/testapp2.rb +51 -0
- data/examples/testcombo.rb +2 -2
- data/examples/testgmail.rb +46 -0
- data/examples/testlistbox.rb +0 -1
- data/examples/testmultispl.rb +199 -0
- data/examples/testree.rb +127 -0
- data/examples/testscroller.rb +0 -1
- data/examples/testscrolllb.rb +1 -1
- data/examples/testscrollp.rb +2 -1
- data/examples/testscrollta.rb +1 -1
- data/examples/testscrolltable.rb +1 -2
- data/examples/testsplit.rb +1 -1
- data/examples/testsplit2.rb +1 -1
- data/examples/testsplit3.rb +1 -1
- data/examples/testsplit3_1.rb +1 -1
- data/examples/testsplit3a.rb +1 -1
- data/examples/testsplit3b.rb +1 -1
- data/examples/testsplitta.rb +1 -1
- data/examples/testsplittv.rb +1 -1
- data/examples/testsplittvv.rb +1 -1
- data/examples/testtodo.rb +491 -488
- data/examples/testvimsplit.rb +111 -0
- data/examples/todo.db +0 -0
- data/examples/todocsv.csv +28 -0
- data/examples/viewtodo.rb +408 -403
- data/lib/rbcurse/action.rb +1 -0
- data/lib/rbcurse/app.rb +1294 -0
- data/lib/rbcurse/applicationheader.rb +7 -2
- data/lib/rbcurse/checkboxcellrenderer.rb +0 -12
- data/lib/rbcurse/colormap.rb +34 -8
- data/lib/rbcurse/comboboxcellrenderer.rb +0 -11
- data/lib/rbcurse/defaultlistselectionmodel.rb +23 -7
- data/lib/rbcurse/extras/bottomline.rb +1681 -0
- data/lib/rbcurse/extras/directorylist.rb +445 -0
- data/lib/rbcurse/extras/directorytree.rb +69 -0
- data/lib/rbcurse/extras/divider.rb +310 -0
- data/lib/rbcurse/extras/focusmanager.rb +31 -0
- data/lib/rbcurse/extras/listselectable.rb +222 -0
- data/lib/rbcurse/extras/masterdetail.rb +164 -0
- data/lib/rbcurse/extras/menutree.rb +63 -0
- data/lib/rbcurse/extras/rlink.rb +27 -0
- data/lib/rbcurse/extras/rmenulink.rb +21 -0
- data/lib/rbcurse/extras/scrollbar.rb +134 -0
- data/lib/rbcurse/extras/stdscrwindow.rb +247 -0
- data/lib/rbcurse/extras/tabular.rb +258 -0
- data/lib/rbcurse/extras/tabularwidget.rb +1070 -0
- data/lib/rbcurse/extras/viewer.rb +106 -0
- data/lib/rbcurse/io.rb +137 -80
- data/lib/rbcurse/keylabelprinter.rb +4 -0
- data/lib/rbcurse/listcellrenderer.rb +91 -59
- data/lib/rbcurse/listscrollable.rb +93 -95
- data/lib/rbcurse/listselectable.rb +60 -7
- data/lib/rbcurse/ractionevent.rb +67 -0
- data/lib/rbcurse/rbasiclistbox.rb +688 -0
- data/lib/rbcurse/rcombo.rb +5 -5
- data/lib/rbcurse/rcommandwindow.rb +555 -0
- data/lib/rbcurse/rinputdataevent.rb +12 -0
- data/lib/rbcurse/rlistbox.rb +305 -124
- data/lib/rbcurse/rmenu.rb +99 -46
- data/lib/rbcurse/rmessagebox.rb +13 -6
- data/lib/rbcurse/rmulticontainer.rb +54 -93
- data/lib/rbcurse/rmultisplit.rb +731 -0
- data/lib/rbcurse/rmultitextview.rb +3 -2
- data/lib/rbcurse/rpopupmenu.rb +0 -1
- data/lib/rbcurse/rprogress.rb +117 -0
- data/lib/rbcurse/rscrollpane.rb +2 -1
- data/lib/rbcurse/rsplitpane.rb +94 -20
- data/lib/rbcurse/rsplitpane2.rb +1009 -0
- data/lib/rbcurse/rtabbedpane.rb +3 -2
- data/lib/rbcurse/rtabbedwindow.rb +0 -1
- data/lib/rbcurse/rtable.rb +92 -64
- data/lib/rbcurse/rtextarea.rb +91 -57
- data/lib/rbcurse/rtextview.rb +223 -70
- data/lib/rbcurse/rtree.rb +723 -0
- data/lib/rbcurse/rviewport.rb +2 -1
- data/lib/rbcurse/rvimsplit.rb +768 -0
- data/lib/rbcurse/rwidget.rb +524 -325
- data/lib/rbcurse/table/tablecellrenderer.rb +1 -1
- data/lib/rbcurse/table/tabledatecellrenderer.rb +0 -1
- data/lib/rbcurse/tree/treecellrenderer.rb +137 -0
- data/lib/rbcurse/tree/treemodel.rb +428 -0
- data/lib/rbcurse/vieditable.rb +14 -13
- data/lib/ver/ncurses.rb +6 -0
- data/lib/ver/window.rb +67 -32
- metadata +99 -23
- data/bin/rbcurse +0 -0
- data/examples/rvimsplit.rb +0 -376
- data/examples/todo.rb +0 -1
- data/lib/rbcurse/rform.rb +0 -845
- data/lib/rbcurse/selectable.rb +0 -94
- data/rbcurse.gemspec +0 -188
data/examples/testcombo.rb
CHANGED
@@ -33,12 +33,12 @@ if $0 == __FILE__
|
|
33
33
|
name "combo"
|
34
34
|
row r
|
35
35
|
col c
|
36
|
-
bgcolor
|
36
|
+
bgcolor :magenta
|
37
37
|
display_length 10
|
38
38
|
editable false
|
39
39
|
list mylist
|
40
40
|
set_label Label.new @form, {'text' => "Non-edit Combo"}
|
41
|
-
list_config 'color' => '
|
41
|
+
list_config 'color' => 'black', 'bgcolor'=>'magenta', 'max_visible_items' => 6
|
42
42
|
end
|
43
43
|
r+=1
|
44
44
|
$results = Variable.new
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'gmail'
|
2
|
+
$b = Time.now
|
3
|
+
def p
|
4
|
+
s= $b
|
5
|
+
$b = Time.now
|
6
|
+
" ----------> " + ($b - s).to_s
|
7
|
+
end
|
8
|
+
username = ENV['GMAIL_USER']+"@gmail.com"
|
9
|
+
pass = ENV['GMAIL_PASS']
|
10
|
+
puts "b4 connect " #+ p()
|
11
|
+
gmail = Gmail.connect!(username, pass)
|
12
|
+
puts "connected " + p()
|
13
|
+
puts gmail.labels.all
|
14
|
+
$b = Time.now
|
15
|
+
gmail.label('INBOX') do |mailbox|
|
16
|
+
urc = mailbox.count(:unread)
|
17
|
+
puts "unread: #{urc} " + p()
|
18
|
+
all = mailbox.count(:all)
|
19
|
+
puts "all: #{all} " + p()
|
20
|
+
x = mailbox.emails(:all)
|
21
|
+
puts "got x " + p()
|
22
|
+
imap = gmail.connection
|
23
|
+
puts "imap #{imap.class} #{imap} "
|
24
|
+
uids = []
|
25
|
+
#mailbox.emails(:all) do |email|
|
26
|
+
#uid = email.uid
|
27
|
+
#envelope = gmail.connection.uid_fetch(uid, "ENVELOPE")[0].attr["ENVELOPE"]
|
28
|
+
#puts envelope.subject
|
29
|
+
##print " #{email['From']} "
|
30
|
+
##print " #{email.header} "
|
31
|
+
#end
|
32
|
+
mailbox.emails(:all) do |email|
|
33
|
+
uid = email.uid
|
34
|
+
uids << uid
|
35
|
+
#puts envelope.subject
|
36
|
+
#print " #{email['From']} "
|
37
|
+
#print " #{email.header} "
|
38
|
+
end
|
39
|
+
envelopes = gmail.connection.uid_fetch(uids, "ENVELOPE")
|
40
|
+
envelopes.each { |ee|
|
41
|
+
e = ee.attr["ENVELOPE"]
|
42
|
+
puts e.subject
|
43
|
+
}
|
44
|
+
puts
|
45
|
+
puts "finished loop " + p()
|
46
|
+
end
|
data/examples/testlistbox.rb
CHANGED
@@ -0,0 +1,199 @@
|
|
1
|
+
$LOAD_PATH << "/Users/rahul/work/projects/rbcurse/lib"
|
2
|
+
require 'rbcurse'
|
3
|
+
require 'rbcurse/rmultisplit'
|
4
|
+
require 'rbcurse/rlistbox'
|
5
|
+
require 'fileutils'
|
6
|
+
|
7
|
+
#
|
8
|
+
## this sample creates a multisplitpane with n objects
|
9
|
+
##+ and move divider around using - + and =.
|
10
|
+
# TODO:
|
11
|
+
# x Status bar below to reflect full path.
|
12
|
+
# - enter to gotonext component too, or at least make visible if not
|
13
|
+
# but now cursor is showing around everywhere
|
14
|
+
#
|
15
|
+
$counter = 0
|
16
|
+
|
17
|
+
# when displaying a filename, if directory prepend a slash.
|
18
|
+
def format list, fullname=nil
|
19
|
+
list.collect! {|e|
|
20
|
+
if fullname
|
21
|
+
f = File.join(fullname, e)
|
22
|
+
else
|
23
|
+
f = e
|
24
|
+
end
|
25
|
+
if File.directory? f
|
26
|
+
"/" + e
|
27
|
+
else
|
28
|
+
e
|
29
|
+
end
|
30
|
+
}
|
31
|
+
list
|
32
|
+
end
|
33
|
+
# @param [Listbox] new list to bind
|
34
|
+
# @param [Array] array of lists
|
35
|
+
# @param [MultiSplit] msp object to add a new list to
|
36
|
+
def bind_list(listb, lists, splitp)
|
37
|
+
#listb.bind(:ENTER_ROW, mylist) {|lb,list| row_cmd.call(lb,list) }
|
38
|
+
listb.bind(:PRESS) {
|
39
|
+
#@status_row.text = "Selected #{tablelist.get_content()[tablelist.current_index]}"
|
40
|
+
item = "#{listb.get_content()[listb.current_index]}"
|
41
|
+
fullname = File.join(listb.config[:path], item)
|
42
|
+
mylist = nil
|
43
|
+
if File.directory? fullname
|
44
|
+
$log.debug " DIRector is a item #{item} "
|
45
|
+
d = Dir.new(fullname)
|
46
|
+
mylist = d.entries
|
47
|
+
mylist.delete "."
|
48
|
+
mylist.delete ".."
|
49
|
+
format(mylist, fullname)
|
50
|
+
# NOTE that we create component with nil form as container will manage it
|
51
|
+
if lists.empty? || lists.last == listb
|
52
|
+
$counter += 1
|
53
|
+
listc = Listbox.new nil do
|
54
|
+
name "LIST#{$counter}"
|
55
|
+
list mylist
|
56
|
+
title item
|
57
|
+
title_attrib 'reverse'
|
58
|
+
end
|
59
|
+
listc.one_key_selection = false
|
60
|
+
listc.bind(:ENTER) {|l| l.title_attrib 'reverse'; }
|
61
|
+
listc.bind(:LEAVE) {|l| l.title_attrib 'normal'; }
|
62
|
+
# FIXME crashes if file nil
|
63
|
+
row_cmd = lambda {|lb, oldlist| list = lb.list(); file = list[lb.current_index]; file ||= "?"; $message.value = File.join(lb.config[:path], file); }
|
64
|
+
listc.bind(:ENTER_ROW, mylist) {|lb,list| row_cmd.call(lb,list) }
|
65
|
+
splitp.add listc
|
66
|
+
lists << listc
|
67
|
+
listb.config[:child] = listc
|
68
|
+
listc.config[:path] = File.join(listb.config[:path], item)
|
69
|
+
bind_list(listc, lists, splitp)
|
70
|
+
else
|
71
|
+
#l = lists.first
|
72
|
+
l = listb.config[:child]
|
73
|
+
l.list_data_model.remove_all
|
74
|
+
# if empty maybe we should remove it, but its just a demo
|
75
|
+
# what happens is, this comes up again when going through another
|
76
|
+
# directory. First go down rbcurse/lib/rbcurse/extras
|
77
|
+
# then go to examples which has a shallow structure.
|
78
|
+
l.list_data_model.insert 0, *mylist unless mylist.empty?
|
79
|
+
l.config[:path] = fullname
|
80
|
+
l.title = item
|
81
|
+
while true
|
82
|
+
n = l.config[:child]
|
83
|
+
break if n.nil?
|
84
|
+
n.list_data_model.remove_all
|
85
|
+
# TODO should be removed, so focus does not go to it
|
86
|
+
n.title = ""
|
87
|
+
l = n
|
88
|
+
end
|
89
|
+
$log.debug " MYLIST #{mylist} dir #{item} "
|
90
|
+
end
|
91
|
+
splitp.goto_next_component
|
92
|
+
end
|
93
|
+
}
|
94
|
+
end
|
95
|
+
if $0 == __FILE__
|
96
|
+
include RubyCurses
|
97
|
+
include RubyCurses::Utils
|
98
|
+
|
99
|
+
begin
|
100
|
+
# Initialize curses
|
101
|
+
VER::start_ncurses # this is initializing colors via ColorMap.setup
|
102
|
+
$log = Logger.new((File.join(ENV['LOGDIR'] || "./" ,"view.log")))
|
103
|
+
|
104
|
+
$log.level = Logger::DEBUG
|
105
|
+
|
106
|
+
@window = VER::Window.root_window
|
107
|
+
|
108
|
+
catch(:close) do
|
109
|
+
@form = Form.new @window
|
110
|
+
r = 3; c = 7; ht = 18
|
111
|
+
#lastrow = ht+r+5 # 26
|
112
|
+
lastrow = Ncurses.LINES-1
|
113
|
+
|
114
|
+
|
115
|
+
help = "F1 to quit. #{$0} Press Enter on directory, TAB/BTAB to navigate. C-w+-= "
|
116
|
+
RubyCurses::Label.new @form, {:text => help, :row => lastrow, "col" => 2, "color" => "yellow" }
|
117
|
+
title = "Demo of Multi-SplitPane (Column Browse pattern)"
|
118
|
+
RubyCurses::Label.new @form, {:text => title, :row => 1, :col => c, :color => "white" }
|
119
|
+
|
120
|
+
|
121
|
+
splitp = MultiSplit.new @form do
|
122
|
+
name "mypane"
|
123
|
+
row r
|
124
|
+
col c
|
125
|
+
width 70
|
126
|
+
height ht
|
127
|
+
split_count 3
|
128
|
+
unlimited true
|
129
|
+
orientation :VERTICAL_SPLIT
|
130
|
+
max_visible 3
|
131
|
+
end
|
132
|
+
splitp.bind(:PROPERTY_CHANGE){|e| $message.value = e.to_s }
|
133
|
+
|
134
|
+
$message = Variable.new
|
135
|
+
$message.value = "Message Comes Here"
|
136
|
+
message_label = RubyCurses::Label.new @form, {'text_variable' => $message, "name"=>"message_label","row" => ht+r+2, "col" => 1, "display_length" => 80, "height" => 2, 'color' => 'cyan'}
|
137
|
+
$message.update_command() { message_label.repaint } # why ?
|
138
|
+
#message_label.row = splitp.row + splitp.height
|
139
|
+
#message_label.col = splitp.col
|
140
|
+
@form.place_below(message_label)
|
141
|
+
|
142
|
+
|
143
|
+
lists = []
|
144
|
+
FileUtils.cd("..")
|
145
|
+
mylist = Dir.glob('*')
|
146
|
+
mylist.delete_if {|x| x =~ /^\./ || x =~ /^_/ || x =~ /bak$/}
|
147
|
+
format(mylist)
|
148
|
+
# NOTE that we create component with nil form as container will manage it
|
149
|
+
listb = Listbox.new nil do
|
150
|
+
name "mainlist"
|
151
|
+
list mylist
|
152
|
+
title "A short list"
|
153
|
+
title_attrib 'reverse'
|
154
|
+
end
|
155
|
+
listb.config[:path] = Dir.getwd
|
156
|
+
listb.one_key_selection = false
|
157
|
+
splitp.add listb
|
158
|
+
row_cmd = lambda {|lb, list| file = list[lb.current_index]; $message.value = file; # File.stat("#{cur_dir()}/#{file}").inspect
|
159
|
+
}
|
160
|
+
listb.bind(:ENTER_ROW, mylist) {|lb,list| row_cmd.call(lb,list) }
|
161
|
+
listb.bind(:ENTER) {|l| l.title_attrib 'reverse'; }
|
162
|
+
listb.bind(:LEAVE) {|l| l.title_attrib 'normal'; }
|
163
|
+
bind_list(listb, lists, splitp)
|
164
|
+
|
165
|
+
# Dummy field just to see navigation from and to container
|
166
|
+
fname = "Search"
|
167
|
+
r, c = @form.next_position
|
168
|
+
c += fname.length + 1
|
169
|
+
field = Field.new @form do
|
170
|
+
name fname
|
171
|
+
row r
|
172
|
+
col c
|
173
|
+
display_length 30
|
174
|
+
bgcolor 'cyan'
|
175
|
+
#set_buffer "abcd "
|
176
|
+
set_label Label.new @form, {:text => fname, :color=>'white',:bgcolor=>'red', :mnemonic=> 's'}
|
177
|
+
end
|
178
|
+
|
179
|
+
@form.repaint
|
180
|
+
@window.wrefresh
|
181
|
+
Ncurses::Panel.update_panels
|
182
|
+
counter = 0
|
183
|
+
while((ch = @window.getchar()) != KEY_F1 )
|
184
|
+
str = keycode_tos ch
|
185
|
+
@form.handle_key(ch)
|
186
|
+
@window.wrefresh
|
187
|
+
end
|
188
|
+
end
|
189
|
+
rescue => ex
|
190
|
+
ensure
|
191
|
+
@window.destroy if !@window.nil?
|
192
|
+
VER::stop_ncurses
|
193
|
+
p ex if ex
|
194
|
+
puts(ex.backtrace.join("\n")) if ex
|
195
|
+
$log.debug( ex) if ex
|
196
|
+
$log.debug(ex.backtrace.join("\n")) if ex
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
data/examples/testree.rb
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
require 'rbcurse'
|
2
|
+
require 'rbcurse/rtree'
|
3
|
+
|
4
|
+
if $0 == __FILE__
|
5
|
+
$choice = ARGV[0].to_i || 1
|
6
|
+
class Tester
|
7
|
+
def initialize
|
8
|
+
acolor = $reversecolor
|
9
|
+
end
|
10
|
+
def run
|
11
|
+
@window = VER::Window.root_window
|
12
|
+
@form = Form.new @window
|
13
|
+
|
14
|
+
h = 20; w = 75; t = 3; l = 4
|
15
|
+
#$choice = 1
|
16
|
+
case $choice
|
17
|
+
when 1
|
18
|
+
root = TreeNode.new "ROOT"
|
19
|
+
subroot = TreeNode.new "subroot"
|
20
|
+
leaf1 = TreeNode.new "leaf 1"
|
21
|
+
leaf2 = TreeNode.new "leaf 2"
|
22
|
+
|
23
|
+
model = DefaultTreeModel.new root
|
24
|
+
#model.insert_node_into(subroot, root, 0)
|
25
|
+
#model.insert_node_into(leaf1, subroot, 0)
|
26
|
+
#model.insert_node_into(leaf2, subroot, 1)
|
27
|
+
root << subroot
|
28
|
+
subroot << leaf1 << leaf2
|
29
|
+
leaf1 << "leaf11"
|
30
|
+
leaf1 << "leaf12"
|
31
|
+
|
32
|
+
root.add "blocky", true do
|
33
|
+
add "block2"
|
34
|
+
add "block3" do
|
35
|
+
add "block31"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
Tree.new @form, :data => model, :row =>2, :col=>2, :height => 20, :width => 30
|
39
|
+
|
40
|
+
when 2
|
41
|
+
|
42
|
+
# use an array to populate
|
43
|
+
# we need to do root_visible = false so you get just a list
|
44
|
+
model = %W[ ruby cobol jruby smalltalk fortran piethon purrl lithp ]
|
45
|
+
Tree.new @form, :data => model, :row =>2, :col=>2, :height => 20, :width => 30
|
46
|
+
|
47
|
+
when 3
|
48
|
+
#else
|
49
|
+
|
50
|
+
# use an Has to populate
|
51
|
+
#model = { :ruby => %W[ "jruby", "mri", "yarv", "rubinius", "macruby" ], :python => %W[ cpython jython laden-swallow ] }
|
52
|
+
model = { :ruby => [ "jruby", {:mri => %W[ 1.8.6 1.8.7]}, {:yarv => %W[1.9.1 1.9.2]}, "rubinius", "macruby" ], :python => %W[ cpython jython laden-swallow ] }
|
53
|
+
|
54
|
+
Tree.new @form, :data => model, :row =>2, :col=>2, :height => 20, :width => 30
|
55
|
+
when 4
|
56
|
+
Tree.new @form, :row =>2, :col=>2, :height => 20, :width => 30 do
|
57
|
+
root "root" do
|
58
|
+
branch "hello" do
|
59
|
+
leaf "world"
|
60
|
+
end
|
61
|
+
branch "goodbyee" do
|
62
|
+
leaf "java"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
ok_button = Button.new @form do
|
72
|
+
text "+"
|
73
|
+
name "+"
|
74
|
+
row 27
|
75
|
+
col 10
|
76
|
+
end
|
77
|
+
#ok_button.command { |form| @vim.weight(@vim.weight + 0.1) }
|
78
|
+
ok_button.command { @vim.increase_weight }
|
79
|
+
|
80
|
+
|
81
|
+
k_button = Button.new @form do
|
82
|
+
text "-"
|
83
|
+
name "-"
|
84
|
+
row 27
|
85
|
+
col 17
|
86
|
+
end
|
87
|
+
#k_button.command { |form| @vim.weight( @vim.weight - 0.1) }
|
88
|
+
k_button.command { |form| @vim.decrease_weight }
|
89
|
+
|
90
|
+
#
|
91
|
+
@help = "F1 to quit. #{$0} "
|
92
|
+
RubyCurses::Label.new @form, {'text' => @help, "row" => 1, "col" => 2, "color" => "yellow"}
|
93
|
+
@form.repaint
|
94
|
+
@window.wrefresh
|
95
|
+
Ncurses::Panel.update_panels
|
96
|
+
while((ch = @window.getchar()) != KEY_F1 )
|
97
|
+
ret = @form.handle_key(ch)
|
98
|
+
@window.wrefresh
|
99
|
+
if ret == :UNHANDLED
|
100
|
+
str = keycode_tos ch
|
101
|
+
$log.debug " UNHANDLED #{str} by Vim #{ret} "
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
@window.destroy
|
106
|
+
|
107
|
+
end
|
108
|
+
end
|
109
|
+
include RubyCurses
|
110
|
+
include RubyCurses::Utils
|
111
|
+
# Initialize curses
|
112
|
+
begin
|
113
|
+
# XXX update with new color and kb
|
114
|
+
VER::start_ncurses # this is initializing colors via ColorMap.setup
|
115
|
+
$log = Logger.new("view.log")
|
116
|
+
$log.level = Logger::DEBUG
|
117
|
+
n = Tester.new
|
118
|
+
n.run
|
119
|
+
rescue => ex
|
120
|
+
ensure
|
121
|
+
VER::stop_ncurses
|
122
|
+
p ex if ex
|
123
|
+
puts(ex.backtrace.join("\n")) if ex
|
124
|
+
$log.debug( ex) if ex
|
125
|
+
$log.debug(ex.backtrace.join("\n")) if ex
|
126
|
+
end
|
127
|
+
end
|
data/examples/testscroller.rb
CHANGED
data/examples/testscrolllb.rb
CHANGED
@@ -13,7 +13,7 @@ if $0 == __FILE__
|
|
13
13
|
begin
|
14
14
|
# Initialize curses
|
15
15
|
VER::start_ncurses # this is initializing colors via ColorMap.setup
|
16
|
-
$log = Logger.new("
|
16
|
+
$log = Logger.new((File.join(ENV["LOGDIR"] || "./" ,"view.log")))
|
17
17
|
$log.level = Logger::DEBUG
|
18
18
|
|
19
19
|
@window = VER::Window.root_window
|
data/examples/testscrollp.rb
CHANGED
@@ -15,9 +15,10 @@ if $0 == __FILE__
|
|
15
15
|
begin
|
16
16
|
# Initialize curses
|
17
17
|
VER::start_ncurses # this is initializing colors via ColorMap.setup
|
18
|
-
$log = Logger.new("
|
18
|
+
$log = Logger.new((File.join(ENV["LOGDIR"] || "./" ,"view.log")))
|
19
19
|
$log.level = Logger::DEBUG
|
20
20
|
|
21
|
+
|
21
22
|
@window = VER::Window.root_window
|
22
23
|
|
23
24
|
catch(:close) do
|
data/examples/testscrollta.rb
CHANGED
@@ -13,7 +13,7 @@ if $0 == __FILE__
|
|
13
13
|
begin
|
14
14
|
# Initialize curses
|
15
15
|
VER::start_ncurses # this is initializing colors via ColorMap.setup
|
16
|
-
$log = Logger.new("
|
16
|
+
$log = Logger.new((File.join(ENV["LOGDIR"] || "./" ,"view.log")))
|
17
17
|
$log.level = Logger::DEBUG
|
18
18
|
|
19
19
|
@window = VER::Window.root_window
|
data/examples/testscrolltable.rb
CHANGED
@@ -38,8 +38,7 @@ if $0 == __FILE__
|
|
38
38
|
begin
|
39
39
|
# Initialize curses
|
40
40
|
VER::start_ncurses # this is initializing colors via ColorMap.setup
|
41
|
-
|
42
|
-
$log = Logger.new("v#{$0}.log")
|
41
|
+
$log = Logger.new((File.join(ENV["LOGDIR"] || "./" ,"view.log")))
|
43
42
|
$log.level = Logger::DEBUG
|
44
43
|
|
45
44
|
@window = VER::Window.root_window
|