canis 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -9
  3. data/CHANGES +3 -0
  4. data/README.md +5 -3
  5. data/examples/alpmenu.rb +9 -5
  6. data/examples/app.sample +2 -2
  7. data/examples/appemail.rb +15 -15
  8. data/examples/atree.rb +7 -7
  9. data/examples/bline.rb +19 -19
  10. data/examples/common/devel.rb +3 -3
  11. data/examples/dbdemo.rb +53 -49
  12. data/examples/dirtree.rb +22 -19
  13. data/examples/newtabbedwindow.rb +5 -5
  14. data/examples/newtesttabp.rb +3 -3
  15. data/examples/tabular.rb +11 -11
  16. data/examples/tasks.rb +25 -25
  17. data/examples/term2.rb +8 -8
  18. data/examples/testbuttons.rb +24 -24
  19. data/examples/testcombo.rb +5 -5
  20. data/examples/testdb.rb +6 -6
  21. data/examples/testfields.rb +16 -16
  22. data/examples/testflowlayout.rb +3 -3
  23. data/examples/testkeypress.rb +5 -5
  24. data/examples/testlistbox.rb +18 -18
  25. data/examples/testlistbox1.rb +17 -17
  26. data/examples/testmessagebox.rb +5 -5
  27. data/examples/testprogress.rb +6 -6
  28. data/examples/testree.rb +3 -3
  29. data/examples/testsplitlayout.rb +4 -4
  30. data/examples/testsplitlayout1.rb +4 -4
  31. data/examples/teststacklayout.rb +4 -4
  32. data/examples/testwsshortcuts.rb +1 -1
  33. data/examples/testwsshortcuts2.rb +4 -4
  34. data/lib/canis/core/include/colorparser.rb +4 -4
  35. data/lib/canis/core/include/io.rb +3 -3
  36. data/lib/canis/core/include/layouts/abstractlayout.rb +3 -3
  37. data/lib/canis/core/include/layouts/flowlayout.rb +2 -2
  38. data/lib/canis/core/include/layouts/stacklayout.rb +3 -3
  39. data/lib/canis/core/system/colormap.rb +3 -3
  40. data/lib/canis/core/system/window.rb +7 -4
  41. data/lib/canis/core/util/extras/padreader.rb +2 -2
  42. data/lib/canis/core/util/rcommandwindow.rb +8 -4
  43. data/lib/canis/core/util/rdialogs.rb +1 -1
  44. data/lib/canis/core/util/widgetshortcuts.rb +9 -2
  45. data/lib/canis/core/widgets/applicationheader.rb +6 -2
  46. data/lib/canis/core/widgets/divider.rb +6 -2
  47. data/lib/canis/core/widgets/rmenu.rb +8 -4
  48. data/lib/canis/core/widgets/rmessagebox.rb +2 -2
  49. data/lib/canis/core/widgets/rwidget.rb +15 -15
  50. data/lib/canis/core/widgets/scrollbar.rb +5 -2
  51. data/lib/canis/core/widgets/table.rb +2 -2
  52. data/lib/canis/core/widgets/textpad.rb +8 -8
  53. data/lib/canis/core/widgets/tree.rb +57 -39
  54. data/lib/canis/core/widgets/tree/treecellrenderer.rb +3 -3
  55. data/lib/canis/version.rb +1 -1
  56. metadata +12 -13
  57. data/lib/canis/core/include/.DS_Store +0 -0
@@ -1,9 +1,8 @@
1
1
  require 'canis/core/util/app'
2
2
  require 'fileutils'
3
3
  require 'canis/core/widgets/tree/treemodel'
4
- #require 'canis/common/file'
5
- require './common/file'
6
- require './common/devel'
4
+ require_relative './common/file'
5
+ require_relative './common/devel'
7
6
 
8
7
  def _directories wd
9
8
  $log.debug " directories got :#{wd}: "
@@ -16,7 +15,7 @@ def _directories wd
16
15
  return ent
17
16
  end
18
17
  $log = create_logger "canis14.log"
19
- App.new do
18
+ App.new do
20
19
  def help_text
21
20
  <<-eos
22
21
 
@@ -41,6 +40,7 @@ App.new do
41
40
  [index]
42
41
  eos
43
42
  end
43
+
44
44
  # print the dir list on the right listbox upon pressing ENTER or row_selector (v)
45
45
  # separated here so it can be called from two places.
46
46
  def lister node
@@ -56,15 +56,20 @@ App.new do
56
56
  files.delete(".")
57
57
  #files = file_listing path, :mode => :LONG
58
58
  ll.clear_selection
59
- ll.list files
59
+ ll.list files
60
60
  ll.title path
61
61
  #TODO show all details in filelist
62
62
  @current_path = path
63
63
  return path
64
64
  end
65
65
  end
66
- header = app_header "canis #{Canis::VERSION}", :text_center => "Dorado", :text_right =>"Directory Lister" , :color => :white, :bgcolor => 242 #, :attr => Ncurses::A_BLINK
66
+
67
+ header = app_header "canis #{Canis::VERSION}",
68
+ :text_center => "Dorado",
69
+ :text_right =>"Directory Lister" ,
70
+ :color => :white, :bgcolor => 242 #, :attr => Ncurses::A_BLINK
67
71
  message "Press Enter to expand/collapse, v to view in lister. <F1> Help"
72
+
68
73
  @form.help_manager.help_text = help_text()
69
74
 
70
75
  pwd = Dir.getwd
@@ -73,27 +78,25 @@ App.new do
73
78
  # we have an array of path, to add recursively, one below the other
74
79
  nodes = []
75
80
  nodes << TreeNode.new(patharray.shift)
76
- patharray.each do |e|
81
+ patharray.each do |e|
77
82
  nodes << nodes.last.add(e)
78
83
  end
79
84
  last = nodes.last
80
85
  nodes.last.add entries
81
86
  model = DefaultTreeModel.new nodes.first
82
87
  model.root_visible = false
83
-
84
-
85
88
 
86
89
  ht = FFI::NCurses.LINES - 2
87
90
  borderattrib = :normal
88
91
  flow :margin_top => 1, :margin_left => 0, :width => :expand, :height => ht do
89
- @t = tree :data => model, :width_pc => 30, :border_attrib => borderattrib
90
- rend = @t.renderer # just test method out.
92
+ @tree = tree :data => model, :width_pc => 30, :border_attrib => borderattrib
93
+ rend = @tree.renderer # just test method out.
91
94
  rend.row_selected_attr = BOLD
92
- @t.bind :TREE_WILL_EXPAND_EVENT do |node|
95
+ @tree.bind :TREE_WILL_EXPAND_EVENT do |node|
93
96
  path = File.join(*node.user_object_path)
94
97
  dirs = _directories path
95
98
  ch = node.children
96
- ch.each do |e|
99
+ ch.each do |e|
97
100
  o = e.user_object
98
101
  if dirs.include? o
99
102
  dirs.delete o
@@ -105,11 +108,11 @@ App.new do
105
108
  node.add dirs
106
109
  lister node
107
110
  end
108
- @t.bind :TREE_WILL_COLLAPSE_EVENT do |node|
111
+ @tree.bind :TREE_WILL_COLLAPSE_EVENT do |node|
109
112
  # FIXME do if ony not already showing on other side
110
113
  lister node
111
114
  end
112
- @t.bind :TREE_SELECTION_EVENT do |ev|
115
+ @tree.bind :TREE_SELECTION_EVENT do |ev|
113
116
  if ev.state == :SELECTED
114
117
  node = ev.node
115
118
  lister node
@@ -117,8 +120,8 @@ App.new do
117
120
  end # select
118
121
  #$def_bg_color = :blue
119
122
  @form.bgcolor = :blue
120
- @t.expand_node last #
121
- @t.mark_parents_expanded last # make parents visible
123
+ @tree.expand_node last #
124
+ @tree.mark_parents_expanded last # make parents visible
122
125
  @l = listbox :width_pc => 70, :border_attrib => borderattrib, :selection_mode => :single, :name => 'll',
123
126
  :left_margin => 1
124
127
  @l.renderer directory_renderer(@l)
@@ -153,7 +156,7 @@ App.new do
153
156
  file_edit _f if File.exists? _f
154
157
  end
155
158
  end
156
- @form.bind_key([?\\, ?l, ?1]){
159
+ @form.bind_key([?\\, ?l, ?1]){
157
160
  ll = @form.by_name["ll"]
158
161
  ll.renderer.formatter = proc do | fname, stat, prefix|
159
162
  "%s%-40s | %10d | %s " % [prefix, fname, stat.size, stat.mtime.strftime("%Y-%m-%d")]
@@ -164,7 +167,7 @@ App.new do
164
167
  ll.repaint
165
168
  #ll.fire_dimension_changed
166
169
  }
167
- @form.bind_key([?\\, ?l, ?2]){
170
+ @form.bind_key([?\\, ?l, ?2]){
168
171
  ll = @form.by_name["ll"]
169
172
  ll.renderer.formatter = nil
170
173
  #ll.fire_dimension_changed
@@ -15,9 +15,9 @@ class SetupTabbedPane
15
15
 
16
16
  r = Container.new nil, :suppress_borders => true
17
17
  l1 = Label.new nil, :name => "profile", :attr => 'bold', :text => "Profile"
18
- f1 = LabeledField.new nil, :name => "name", :maxlen => 20, :width => 20, :bgcolor => :white,
18
+ f1 = LabeledField.new nil, :name => "name", :maxlen => 20, :width => 20, :bgcolor => :white,
19
19
  :color => :black, :text => "abc", :label => ' Name: '
20
- f2 = LabeledField.new nil, :name => "email", :width => 20, :bgcolor => :white,
20
+ f2 = LabeledField.new nil, :name => "email", :width => 20, :bgcolor => :white,
21
21
  :color => :blue, :text => "me@google.com", :label => 'Email: '
22
22
  f3 = RadioButton.new nil, :variable => $config_hash, :text => "red", :value => "RED", :color => :red
23
23
  f4 = RadioButton.new nil, :variable => $config_hash, :text => "blue", :value => "BLUE", :color => :blue
@@ -46,14 +46,14 @@ class SetupTabbedPane
46
46
  item RadioButton.new nil, :row => 10, :col => 2, :text => "Underline", :value => "underline", :variable => $config_hash[:cursor]
47
47
  end
48
48
  tab "&Term" do
49
-
49
+
50
50
  item Label.new nil, :text => "Arrow Key in Combos", :row => 2, :col => 2, :attr => 'bold'
51
51
  x = Variable.new
52
52
  $config_hash.set_value x, :term
53
53
  item RadioButton.new nil, :row => 3, :col => 2, :text => "ignore", :value => "ignore", :variable => $config_hash[:term]
54
54
  item RadioButton.new nil, :row => 4, :col => 2, :text => "popup", :value => "popup", :variable => $config_hash[:term]
55
55
  item RadioButton.new nil, :row => 5, :col => 2, :text => "next", :value => "next", :variable => $config_hash[:term]
56
- cb = ComboBox.new nil, :row => 7, :col => 2, :width => 20,
56
+ cb = ComboBox.new nil, :row => 7, :col => 2, :width => 20,
57
57
  :list => %w[xterm xterm-color xterm-256color screen vt100 vt102],
58
58
  :label => "Declare terminal as: "
59
59
  #radio.update_command() {|rb| ENV['TERM']=rb.value }
@@ -61,7 +61,7 @@ class SetupTabbedPane
61
61
  x.update_command do |rb|
62
62
  cb.arrow_key_policy=rb.value.to_sym
63
63
  end
64
-
64
+
65
65
  end
66
66
  tab "Conta&iner" do
67
67
  item r
@@ -24,8 +24,8 @@ class TestTabbedPane
24
24
  tp.add_tab "&Language" do
25
25
  _r = 2
26
26
  colors = [:red, :green, :cyan]
27
- %w[ ruby jruby macruby].each_with_index { |e, i|
28
- item RadioButton.new nil,
27
+ %w[ ruby jruby macruby].each_with_index { |e, i|
28
+ item RadioButton.new nil,
29
29
  :variable => $config_hash,
30
30
  :name => "radio1",
31
31
  :text => e,
@@ -40,7 +40,7 @@ class TestTabbedPane
40
40
  butts = [ "Use &HTTP/1.0", "Use &frames", "&Use SSL" ]
41
41
  bcodes = %w[ HTTP, FRAMES, SSL ]
42
42
  butts.each_with_index do |t, i|
43
- item Canis::CheckBox.new nil,
43
+ item Canis::CheckBox.new nil,
44
44
  :text => butts[i],
45
45
  :variable => $config_hash,
46
46
  :name => bcodes[i],
@@ -2,7 +2,7 @@ require 'canis/core/util/app'
2
2
  require 'canis/core/widgets/listfooter'
3
3
  require 'canis/core/util/promptmenu'
4
4
 
5
- App.new do
5
+ App.new do
6
6
  # TODO: combine this with widget menu
7
7
  def app_menu
8
8
  menu = PromptMenu.new self do
@@ -20,7 +20,7 @@ App.new do
20
20
  # to execute when app_menu is invoked
21
21
  # very tricky , this depends on the keys that have been mapped
22
22
  # Here we are pushing the mapped key to trigger a method.
23
- # FIXME NOTE these have stopped working since I think i now clear keys
23
+ # FIXME NOTE these have stopped working since I think i now clear keys
24
24
  # after a key is processed, so unget will not work.
25
25
  # Use +handle_key+ instead of +ungetch+, although that won't work if multiple
26
26
  # keys involved.
@@ -71,7 +71,7 @@ def help_text
71
71
  <a> - select all
72
72
  <*> - invert selection
73
73
 
74
- </> - <slash> for searching,
74
+ </> - <slash> for searching,
75
75
  <n> to continue searching
76
76
 
77
77
  Keys specific to this example
@@ -81,7 +81,7 @@ def help_text
81
81
  <o> - insert a row after current one
82
82
  <U> - undo delete
83
83
 
84
- Motion keys
84
+ Motion keys
85
85
 
86
86
  Usual for [[list]] and [[textpad]] such as :
87
87
  j, k, h, l
@@ -120,8 +120,8 @@ def _edit h, row, title
120
120
  config = { :width => 70, :title => title }
121
121
  bw = get_color $datacolor, :black, :white
122
122
  mb = MessageBox.new config do
123
- h.each_with_index { |f, i|
124
- add LabeledField.new :label => "%*s:" % [_w, f], :text => row[i].chomp, :name => i.to_s,
123
+ h.each_with_index { |f, i|
124
+ add LabeledField.new :label => "%*s:" % [_w, f], :text => row[i].chomp, :name => i.to_s,
125
125
  :bgcolor => :cyan,
126
126
  :width => 50,
127
127
  :label_color_pair => bw
@@ -130,7 +130,7 @@ def _edit h, row, title
130
130
  end
131
131
  index = mb.run
132
132
  return nil if index != 0
133
- h.each_with_index { |e, i|
133
+ h.each_with_index { |e, i|
134
134
  f = mb.widget(i.to_s)
135
135
  row[i] = f.text
136
136
  }
@@ -177,15 +177,15 @@ lf.command_right(){ |comp|
177
177
  " [#{comp.size} tasks]"
178
178
  }
179
179
  =end
180
- header = app_header "canis #{Canis::VERSION}", :text_center => "Table Demo", :text_right =>": menu",
181
- :color => :black, :bgcolor => :green #, :attr => :bold
180
+ header = app_header "canis #{Canis::VERSION}", :text_center => "Table Demo", :text_right =>": menu",
181
+ :color => :black, :bgcolor => :green #, :attr => :bold
182
182
  message "Press F10 to exit, F1 for help, : for menu"
183
183
  @form.help_manager.help_text = help_text()
184
184
  $orig_cols = Ncurses.COLS
185
185
  $orig_rows = Ncurses.LINES
186
186
 
187
187
  h = %w[ Id Title Priority Status]
188
- file = "data/table.txt"
188
+ file = File.expand_path("../data/table.txt", __FILE__)
189
189
 
190
190
  flow :margin_top => 1, :height => FFI::NCurses.LINES-2 do
191
191
  tw = table :print_footer => true, :name => "tab"
@@ -204,7 +204,7 @@ lf.command_right(){ |comp|
204
204
  tw.bind_key(?e, 'edit row') { edit_row tw }
205
205
  tw.bind_key(?o, 'insert row') { insert_row tw }
206
206
  tw.create_default_sorter
207
-
207
+
208
208
  end # stack
209
209
  status_line :row => FFI::NCurses.LINES-1
210
210
  @form.bind_key(?:, 'menu') { app_menu }
@@ -2,7 +2,7 @@ require 'canis/core/util/app'
2
2
  require 'canis/core/include/defaultfilerenderer'
3
3
  #require 'canis/core/widgets/rlist'
4
4
 
5
- App.new do
5
+ App.new do
6
6
  def resize
7
7
  tab = @form.by_name["tasklist"]
8
8
  cols = Ncurses.COLS
@@ -18,13 +18,13 @@ end
18
18
 
19
19
  message "Press F10 or qq to quit "
20
20
 
21
- file = "data/todo.txt"
21
+ file = File.expand_path("../data/todo.txt", __FILE__)
22
22
  alist = File.open(file,'r').read.split("\n") if File.exists? file
23
23
  #flow :margin_top => 1, :item_width => 50 , :height => FFI::NCurses.LINES-2 do
24
24
  #stack :margin_top => 1, :width => :expand, :height => FFI::NCurses.LINES-4 do
25
25
 
26
26
  #task = field :label => " Task:", :width => 50, :maxlen => 80, :bgcolor => :cyan, :color => :black
27
- #pri = field :label => "Priority:", :width => 1, :maxlen => 1, :type => :integer,
27
+ #pri = field :label => "Priority:", :width => 1, :maxlen => 1, :type => :integer,
28
28
  #:valid_range => 1..9, :bgcolor => :cyan, :color => :black , :default => "5"
29
29
  #pri.overwrite_mode = true
30
30
  # u,se voerwrite mode for this TODO and catch exception
@@ -44,26 +44,26 @@ end
44
44
  lb = listbox :list => alist.sort, :title => "[ todos ]", :name => "tasklist", :row => 1, :height => Ncurses.LINES-4, :width => Ncurses.COLS-1
45
45
  lb.should_show_focus = false
46
46
  lb.renderer dr
47
- lb.bind_key(?d, "Delete Row"){
47
+ lb.bind_key(?d, "Delete Row"){
48
48
  if confirm("Delete #{lb.current_value} ?")
49
- lb.delete_at lb.current_index
49
+ lb.delete_at lb.current_index
50
50
  $data_modified = true
51
51
  # TODO reposition cursor at 0. use list_data_changed ?
52
52
  end
53
53
  }
54
- lb.bind_key(?e, "Edit Row"){
54
+ lb.bind_key(?e, "Edit Row"){
55
55
  if ((value = get_string("Edit Task:", :width => 80, :default => lb.current_value, :maxlen => 80, :width => 70)) != nil)
56
56
 
57
57
  lb[lb.current_index]=value
58
58
  $data_modified = true
59
59
  end
60
60
  }
61
- lb.bind_key(?a, "Add Record"){
61
+ lb.bind_key(?a, "Add Record"){
62
62
 
63
63
  # ADD
64
64
  task = LabeledField.new :label => " Task:", :width => 60, :maxlen => 80, :bgcolor => :cyan, :color => :black,
65
65
  :name => 'task'
66
- pri = LabeledField.new :label => "Priority:", :width => 1, :maxlen => 1, :type => :integer,
66
+ pri = LabeledField.new :label => "Priority:", :width => 1, :maxlen => 1, :type => :integer,
67
67
  :valid_range => 1..9, :bgcolor => :cyan, :color => :black , :default => "5", :name => 'pri'
68
68
  pri.overwrite_mode = true
69
69
  config = {}
@@ -77,10 +77,10 @@ end
77
77
  end
78
78
  index = tp.run
79
79
  if index == 0 # OK
80
- # when does this memory get released ??? XXX
81
- _t = tp.form.by_name['pri'].text
80
+ # when does this memory get released ??? XXX
81
+ _t = tp.form.by_name['pri'].text
82
82
  if _t != ""
83
- val = @default_prefix + tp.form.by_name['pri'].text + ". " + tp.form.by_name['task'].text
83
+ val = @default_prefix + tp.form.by_name['pri'].text + ". " + tp.form.by_name['task'].text
84
84
  w = @form.by_name["tasklist"]
85
85
  _l = w.list
86
86
  _l << val
@@ -92,11 +92,11 @@ end
92
92
  end
93
93
  }
94
94
  # decrease priority
95
- lb.bind_key(?-, 'decrease priority'){
95
+ lb.bind_key(?-, 'decrease priority'){
96
96
  line = lb.current_value
97
97
  p = line[1,1].to_i
98
98
  if p < 9
99
- p += 1
99
+ p += 1
100
100
  line[1,1] = p.to_s
101
101
  lb[lb.current_index]=line
102
102
  lb.list(lb.list.sort)
@@ -104,11 +104,11 @@ end
104
104
  end
105
105
  }
106
106
  # increase priority
107
- lb.bind_key(?+, 'increase priority'){
107
+ lb.bind_key(?+, 'increase priority'){
108
108
  line = lb.current_value
109
109
  p = line[1,1].to_i
110
110
  if p > 1
111
- p -= 1
111
+ p -= 1
112
112
  line[1,1] = p.to_s
113
113
  lb[lb.current_index]=line
114
114
  lb.list(lb.list.sort)
@@ -120,7 +120,7 @@ end
120
120
  end
121
121
  }
122
122
  # mark as done
123
- lb.bind_key(?x, 'mark done'){
123
+ lb.bind_key(?x, 'mark done'){
124
124
  line = lb.current_value
125
125
  line[0,1] = "x"
126
126
  lb[lb.current_index]=line
@@ -128,7 +128,7 @@ end
128
128
  $data_modified = true
129
129
  }
130
130
  # flag task with a single character
131
- lb.bind_key(?!, 'flag'){
131
+ lb.bind_key(?!, 'flag'){
132
132
  line = lb.current_value.chomp
133
133
  value = get_string("Flag for #{line}. Enter one character.", :maxlen => 1, :width => 1)
134
134
  #if ((value = get_string("Edit Task:", :width => 80, :default => lb.current_value)) != nil)
@@ -146,7 +146,7 @@ end
146
146
  @form.bind(:RESIZE) { resize }
147
147
 
148
148
  keyarray = [
149
- ["F1" , "Help"], ["F10" , "Exit"],
149
+ ["F1" , "Help"], ["F10" , "Exit"],
150
150
  ["F2", "Menu"], ["F4", "View"],
151
151
  ["d", "delete item"], ["e", "edit item"],
152
152
  ["a", "add item"], ["x", "close item"],
@@ -156,7 +156,7 @@ end
156
156
  ]
157
157
 
158
158
  gw = get_color($reversecolor, 'green', 'black')
159
- @adock = dock keyarray, { :row => Ncurses.LINES-2, :footer_color_pair => $datacolor,
159
+ @adock = dock keyarray, { :row => Ncurses.LINES-2, :footer_color_pair => $datacolor,
160
160
  :footer_mnemonic_color_pair => gw }
161
161
 
162
162
  @window.confirm_close_command do
@@ -167,13 +167,13 @@ end
167
167
  w = @form.by_name["tasklist"]
168
168
  if confirm("Save tasks?", :default_button => 0)
169
169
  system("cp #{file} #{file}.bak")
170
- File.open(file, 'w') {|f|
171
- w.list.each { |e|
172
- f.puts(e)
173
- }
174
- }
170
+ File.open(file, 'w') {|f|
171
+ w.list.each { |e|
172
+ f.puts(e)
173
+ }
174
+ }
175
175
  end
176
176
  end # if modif
177
177
  end
178
-
178
+
179
179
  end # app
@@ -12,8 +12,8 @@ require 'canis/core/widgets/scrollbar'
12
12
 
13
13
  The 2 tables on the right differ in behaviour. The first puts tabular data
14
14
  into a listbox so you get single/multiple selection. The second puts tabular
15
- data into a textview, so there's no selection. <space> scrolls instead of
16
- selects <ENTER> allows us to use the word under cursor for further actions.
15
+ data into a textview, so there's no selection. <space> scrolls instead of
16
+ selects <ENTER> allows us to use the word under cursor for further actions.
17
17
 
18
18
  To see an example of placing tabular data in a tabular widget, see tabular.rb.
19
19
  The advantage of tabular_widget is column resizing, hiding, aligning and sorting.
@@ -23,8 +23,8 @@ require 'canis/core/widgets/scrollbar'
23
23
 
24
24
  eos
25
25
  end
26
- App.new do
27
- header = app_header "canis #{Canis::VERSION}", :text_center => "Tabular Demo", :text_right =>"New Improved!", :color => :black, :bgcolor => :white, :attr => :bold
26
+ App.new do
27
+ header = app_header "canis #{Canis::VERSION}", :text_center => "Tabular Demo", :text_right =>"New Improved!", :color => :black, :bgcolor => :white, :attr => :bold
28
28
  message "F10 quit, F1 Help, ? Bindings"
29
29
  #install_help_text my_help_text
30
30
  @form.help_manager.help_text = my_help_text
@@ -45,8 +45,8 @@ App.new do
45
45
  end # stack
46
46
 
47
47
 
48
- file = "data/tasks.csv"
49
- lines = File.open(file,'r').readlines
48
+ file = File.expand_path("../data/tasks.csv", __FILE__)
49
+ lines = File.open(file,'r').readlines
50
50
  heads = %w[ id sta type prio title ]
51
51
  t = Tabular.new do |t|
52
52
  t.headings = heads
@@ -63,9 +63,9 @@ App.new do
63
63
  res = r.split("\n")
64
64
 
65
65
  t = Tabular.new do
66
- # self.headings = 'Perm', 'Gr', 'User', 'U', 'Size', 'Mon', 'Date', 'Time', 'File' # changed 2011 dts
66
+ # self.headings = 'Perm', 'Gr', 'User', 'U', 'Size', 'Mon', 'Date', 'Time', 'File' # changed 2011 dts
67
67
  self.headings = 'User', 'Size', 'Mon', 'Date', 'Time', 'File'
68
- res.each { |e|
68
+ res.each { |e|
69
69
  cols = e.split
70
70
  next if cols.count < 6
71
71
  cols = cols[3..-1]