newt 0.9.2 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +37 -28
- data/ext/ruby_newt/extconf.rb +2 -1
- data/ext/ruby_newt/ruby_newt.c +365 -745
- data/lib/newt.rb +2 -12
- data/lib/version.rb +3 -0
- metadata +36 -166
- data/.autotest +0 -9
- data/.gemtest +0 -0
- data/History.txt +0 -4
- data/Manifest.txt +0 -67
- data/Rakefile +0 -26
- data/examples/test-j.rb +0 -118
- data/examples/test.rb +0 -95
- data/examples/test_method/Button_new.rb +0 -22
- data/examples/test_method/Checkbox_get.rb +0 -25
- data/examples/test_method/Checkbox_new.rb +0 -22
- data/examples/test_method/Checkbox_set.rb +0 -28
- data/examples/test_method/Checkbox_set_flags.rb +0 -28
- data/examples/test_method/CompactButton_new.rb +0 -22
- data/examples/test_method/Entry_get.rb +0 -26
- data/examples/test_method/Entry_new.rb +0 -23
- data/examples/test_method/Entry_set.rb +0 -26
- data/examples/test_method/Entry_set_flags.rb +0 -31
- data/examples/test_method/Form_destroy.rb +0 -33
- data/examples/test_method/Form_set_background.rb +0 -23
- data/examples/test_method/Form_set_height.rb +0 -26
- data/examples/test_method/Form_set_width.rb +0 -26
- data/examples/test_method/Grid_new.rb +0 -26
- data/examples/test_method/Label_new.rb +0 -22
- data/examples/test_method/Label_setText.rb +0 -25
- data/examples/test_method/Listbox_clear.rb +0 -25
- data/examples/test_method/Listbox_current_bykey.rb +0 -29
- data/examples/test_method/Listbox_delete.rb +0 -27
- data/examples/test_method/Listbox_get_current.rb +0 -28
- data/examples/test_method/Listbox_insert.rb +0 -24
- data/examples/test_method/Listbox_new.rb +0 -24
- data/examples/test_method/Listbox_select.rb +0 -27
- data/examples/test_method/Listbox_set.rb +0 -27
- data/examples/test_method/Listbox_set_current.rb +0 -26
- data/examples/test_method/Listbox_set_width.rb +0 -25
- data/examples/test_method/Newt_FLAG_SCROLL.rb +0 -21
- data/examples/test_method/RadioButton_new.rb +0 -22
- data/examples/test_method/ReflowText.rb +0 -27
- data/examples/test_method/Scale_new.rb +0 -22
- data/examples/test_method/Scale_set.rb +0 -22
- data/examples/test_method/Screen_bell.rb +0 -10
- data/examples/test_method/Screen_cls.rb +0 -12
- data/examples/test_method/Screen_draw_roottext.rb +0 -16
- data/examples/test_method/Screen_init.rb +0 -11
- data/examples/test_method/Screen_pop_helpline.rb +0 -18
- data/examples/test_method/Screen_push_helpline.rb +0 -16
- data/examples/test_method/Screen_redraw_helpline.rb +0 -18
- data/examples/test_method/Screen_size.rb +0 -15
- data/examples/test_method/Screen_win_menu.rb +0 -19
- data/examples/test_method/TextboxReflowed_new.rb +0 -23
- data/examples/test_method/Textbox_get_num_lines.rb +0 -27
- data/examples/test_method/Textbox_new.rb +0 -22
- data/examples/test_method/Textbox_set_height.rb +0 -25
- data/examples/testgrid-j.rb +0 -85
- data/examples/testgrid.rb +0 -83
- data/examples/testtree-j.rb +0 -55
- data/examples/testtree.rb +0 -54
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/tasks/extconf/ruby_newt.rake +0 -43
- data/tasks/extconf.rake +0 -13
- data/test/test_helper.rb +0 -3
- data/test/test_newt.rb +0 -11
- data/test/test_ruby_newt_extn.rb +0 -10
@@ -1,22 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
begin
|
7
|
-
|
8
|
-
Newt::Screen.new
|
9
|
-
|
10
|
-
s = Newt::Scale.new(1, 1, 30, 100)
|
11
|
-
s.set(20)
|
12
|
-
|
13
|
-
b = Newt::Button.new(10, 13, "Exit")
|
14
|
-
|
15
|
-
f = Newt::Form.new
|
16
|
-
f.add(s, b)
|
17
|
-
|
18
|
-
f.run()
|
19
|
-
|
20
|
-
ensure
|
21
|
-
Newt::Screen.finish
|
22
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
begin
|
7
|
-
Newt::Screen.new
|
8
|
-
|
9
|
-
#Newt::Screen.init
|
10
|
-
|
11
|
-
Newt::Screen.push_helpline("Hit Key!!")
|
12
|
-
Newt::Screen.wait_for_key
|
13
|
-
Newt::Screen.pop_helpline
|
14
|
-
Newt::Screen.wait_for_key
|
15
|
-
|
16
|
-
ensure
|
17
|
-
Newt::Screen.finish
|
18
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
begin
|
7
|
-
Newt::Screen.new
|
8
|
-
|
9
|
-
Newt::Screen.init
|
10
|
-
|
11
|
-
Newt::Screen.push_helpline("Hit Key!!")
|
12
|
-
Newt::Screen.wait_for_key
|
13
|
-
Newt::Screen.redraw_helpline
|
14
|
-
Newt::Screen.wait_for_key
|
15
|
-
|
16
|
-
ensure
|
17
|
-
Newt::Screen.finish
|
18
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
begin
|
7
|
-
|
8
|
-
Newt::Screen.new
|
9
|
-
|
10
|
-
v = Newt::Screen.win_menu("Test Menu", "Text", 50, 5, 5, 3,
|
11
|
-
["One", "Two", "Three"], "OK")
|
12
|
-
|
13
|
-
#Newt::Screen.wait_for_key
|
14
|
-
|
15
|
-
ensure
|
16
|
-
Newt::Screen.finish
|
17
|
-
end
|
18
|
-
|
19
|
-
p v
|
@@ -1,23 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
begin
|
7
|
-
|
8
|
-
Newt::Screen.new
|
9
|
-
|
10
|
-
text = "Line1 Line1 Line1 Line1 Line1 Line1 Line1 Line1 \nLine2"
|
11
|
-
t = Newt::TextboxReflowed.new(1, 1, text, 20, 0, 0, 0)
|
12
|
-
|
13
|
-
b = Newt::Button.new(1, 15, "Exit")
|
14
|
-
|
15
|
-
f = Newt::Form.new
|
16
|
-
f.add(t, b)
|
17
|
-
|
18
|
-
f.run()
|
19
|
-
|
20
|
-
ensure
|
21
|
-
Newt::Screen.finish
|
22
|
-
end
|
23
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# ?
|
4
|
-
|
5
|
-
require 'rubygems'
|
6
|
-
require "newt"
|
7
|
-
|
8
|
-
begin
|
9
|
-
|
10
|
-
Newt::Screen.new
|
11
|
-
|
12
|
-
t = Newt::Textbox.new(1, 1, 20, 10, Newt::FLAG_WRAP)
|
13
|
-
t.set_text("Line1\nLine2\nLine3")
|
14
|
-
line = t.get_num_lines
|
15
|
-
|
16
|
-
b = Newt::Button.new(1, 13, "Exit")
|
17
|
-
|
18
|
-
f = Newt::Form.new
|
19
|
-
f.add(t, b)
|
20
|
-
|
21
|
-
f.run()
|
22
|
-
|
23
|
-
ensure
|
24
|
-
Newt::Screen.finish
|
25
|
-
end
|
26
|
-
|
27
|
-
p line
|
@@ -1,22 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
begin
|
7
|
-
|
8
|
-
Newt::Screen.new
|
9
|
-
|
10
|
-
t = Newt::Textbox.new(1, 1, 20, 10, Newt::FLAG_WRAP)
|
11
|
-
t.set_text("Line1\nLine2\nLine3")
|
12
|
-
|
13
|
-
b = Newt::Button.new(1, 13, "Exit")
|
14
|
-
|
15
|
-
f = Newt::Form.new
|
16
|
-
f.add(t, b)
|
17
|
-
|
18
|
-
f.run()
|
19
|
-
|
20
|
-
ensure
|
21
|
-
Newt::Screen.finish
|
22
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# ?
|
4
|
-
|
5
|
-
require 'rubygems'
|
6
|
-
require "newt"
|
7
|
-
|
8
|
-
begin
|
9
|
-
|
10
|
-
Newt::Screen.new
|
11
|
-
|
12
|
-
t = Newt::Textbox.new(1, 1, 20, 10, Newt::FLAG_WRAP)
|
13
|
-
t.set_text("Line1\nLine2\nLine3")
|
14
|
-
t.set_height(5)
|
15
|
-
|
16
|
-
b = Newt::Button.new(1, 13, "Exit")
|
17
|
-
|
18
|
-
f = Newt::Form.new
|
19
|
-
f.add(t, b)
|
20
|
-
|
21
|
-
f.run()
|
22
|
-
|
23
|
-
ensure
|
24
|
-
Newt::Screen.finish
|
25
|
-
end
|
data/examples/testgrid-j.rb
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
menuContents = ["°ì", "Æó", "»°", "»Í", "¸Þ"]
|
7
|
-
autoEntries = ["¥¨¥ó¥È¥ê", "Ê̤Υ¨¥ó¥È¥ê",
|
8
|
-
"»°ÈÖÌܤΥ¨¥ó¥È¥ê", "»ÍÈÖÌܤΥ¨¥ó¥È¥ê",]
|
9
|
-
|
10
|
-
begin
|
11
|
-
Newt::Screen.new
|
12
|
-
|
13
|
-
b1 = Newt::Checkbox.new(-1, -1, "¥Æ¥¹¥È¤Î¤¿¤á¤Î¤«¤Ê¤êŤ¤¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹", ' ', nil)
|
14
|
-
b2 = Newt::Button.new(-1, -1, "Ê̤Υܥ¿¥ó")
|
15
|
-
b3 = Newt::Button.new(-1, -1, "¤·¤«¤·¡¢¤·¤«¤·")
|
16
|
-
b4 = Newt::Button.new(-1, -1, "¤·¤«¤·²¿¤À¤í¤¦¡©")
|
17
|
-
|
18
|
-
f = Newt::Form.new
|
19
|
-
|
20
|
-
grid = Newt::Grid.new(2, 2)
|
21
|
-
grid.set_field(0, 0, Newt::GRID_COMPONENT, b1, 0, 0, 0, 0,
|
22
|
-
Newt::ANCHOR_RIGHT, 0)
|
23
|
-
grid.set_field(0, 1, Newt::GRID_COMPONENT, b2, 0, 0, 0, 0, 0, 0)
|
24
|
-
grid.set_field(1, 0, Newt::GRID_COMPONENT, b3, 0, 0, 0, 0, 0, 0)
|
25
|
-
grid.set_field(1, 1, Newt::GRID_COMPONENT, b4, 0, 0, 0, 0, 0, 0)
|
26
|
-
|
27
|
-
f.add(b1, b2, b3, b4)
|
28
|
-
|
29
|
-
grid.wrapped_window("°ìÈÖÌܤΥ¦¥£¥ó¥É¥¦")
|
30
|
-
|
31
|
-
answer = f.run()
|
32
|
-
|
33
|
-
#f.destroy()
|
34
|
-
Newt::Screen.pop_window()
|
35
|
-
|
36
|
-
flowedText, textWidth, textHeight = Newt.reflow_text("¤³¤ì¤Ï¤«¤Ê¤ê¥Æ¥¥¹¥È¤é¤·¤¤¤â¤Î¤Ç¤¹¡£40¥«¥é¥à" +
|
37
|
-
"¤ÎŤµ¤Ç¡¢¥é¥Ã¥Ô¥ó¥°¤¬¹Ô¤ï¤ì¤Þ¤¹¡£" +
|
38
|
-
"ÁÇÁᤤ¡¢Ã㿧¤Î¸Ñ¤¬¤Î¤í¤Þ¤Ê¸¤¤òÈô¤Ó" +
|
39
|
-
"±Û¤¨¤¿¤Î¤òÃΤäƤ뤫¤¤?\n\n" +
|
40
|
-
"¾¤Ë¤ªÃΤ餻¤¹¤ë¤³¤È¤È¤·¤Æ¡¢Å¬Åö¤Ë²þ¹Ô¤ò¤¹¤ë" +
|
41
|
-
"¤³¤È¤¬½ÅÍפǤ¹¡£",
|
42
|
-
40, 5, 5)
|
43
|
-
t = Newt::Textbox.new(-1, -1, textWidth, textHeight, Newt::FLAG_WRAP)
|
44
|
-
t.set_text(flowedText)
|
45
|
-
|
46
|
-
b1 = Newt::Button.new(-1, -1, "λ²ò")
|
47
|
-
b2 = Newt::Button.new(-1, -1, "¥¥ã¥ó¥»¥ë")
|
48
|
-
|
49
|
-
grid = Newt::Grid.new(1, 2)
|
50
|
-
subgrid = Newt::Grid.new(2, 1)
|
51
|
-
|
52
|
-
subgrid.set_field(0, 0, Newt::GRID_COMPONENT, b1, 0, 0, 0, 0, 0, 0)
|
53
|
-
subgrid.set_field(1, 0, Newt::GRID_COMPONENT, b2, 0, 0, 0, 0, 0, 0)
|
54
|
-
|
55
|
-
grid.set_field(0, 0, Newt::GRID_COMPONENT, t, 0, 0, 0, 1, 0, 0)
|
56
|
-
grid.set_field(0, 1, Newt::GRID_SUBGRID, subgrid, 0, 0, 0, 0, 0,
|
57
|
-
Newt::GRID_FLAG_GROWX)
|
58
|
-
grid.wrapped_window("Ê̤ÎÎã")
|
59
|
-
|
60
|
-
f = Newt::Form.new
|
61
|
-
f.add(b1, t, b2)
|
62
|
-
#f.add(b1, b2)
|
63
|
-
answer = f.run()
|
64
|
-
|
65
|
-
Newt::Screen.pop_window()
|
66
|
-
#f.destroy()
|
67
|
-
|
68
|
-
Newt::Screen.win_message("¥·¥ó¥×¥ë", "λ²ò", "¤³¤ì¤Ï¥·¥ó¥×¥ë¤Ê¥á¥Ã¥»¡¼¥¸¥¦¥£¥ó¥É¥¦¤Ç¤¹")
|
69
|
-
Newt::Screen.win_choice("¥·¥ó¥×¥ë", "λ²ò", "¥¥ã¥ó¥»¥ë", "¤³¤ì¤Ï¥·¥ó¥×¥ë¤ÊÁªÂò¥¦¥£¥ó¥É¥¦¤Ç¤¹")
|
70
|
-
|
71
|
-
textWidth = Newt::Screen.win_menu("¥Æ¥¹¥È¥á¥Ë¥å¡¼", "¤³¤ì¤Ï newtWinMenu() ¥³¡¼¥ë¤Î¥µ¥ó¥×¥ë" +
|
72
|
-
"¤Ç¤¹¡£ ¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤ÏɬÍפ˱þ¤¸¤Æ¤Ä¤¤¤¿¤ê¡¢ " +
|
73
|
-
"¤Ä¤«¤Ê¤«¤Ã¤¿¤ê¤·¤Þ¤¹¡£", 50, 5, 5, 3,
|
74
|
-
menuContents, "λ²ò", "¥¥ã¥ó¥»¥ë")
|
75
|
-
|
76
|
-
v = Newt::Screen.win_entries("¥Æ¥¥¹¥È newtWinEntries()", "¤³¤ì¤Ï newtWinEntries()" +
|
77
|
-
"¥³¡¼¥ë¤Î¥µ¥ó¥×¥ë¤Ç¤¹¡£¤¿¤¤¤Ø¤ó´Êñ¤Ë¤¿¤¯¤µ¤ó¤ÎÆþÎϤò" +
|
78
|
-
"°·¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£", 50, 5, 5, 20, autoEntries, "λ²ò", "¥¥ã¥ó¥»¥ë")
|
79
|
-
|
80
|
-
ensure
|
81
|
-
Newt::Screen.finish
|
82
|
-
|
83
|
-
printf "item = %d\n", textWidth
|
84
|
-
p v
|
85
|
-
end
|
data/examples/testgrid.rb
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
menuContents = ["One", "Two", "Three", "Four", "Five"]
|
7
|
-
autoEntries = ["An entry", "Another entry",
|
8
|
-
"Third entry", "Fourth entry"]
|
9
|
-
|
10
|
-
Newt::Screen.new
|
11
|
-
|
12
|
-
b1 = Newt::Checkbox.new(-1, -1, "An pretty long checkbox for testing", ' ', nil)
|
13
|
-
b2 = Newt::Button.new(-1, -1, "Another Button")
|
14
|
-
b3 = Newt::Button.new(-1, -1, "But, but")
|
15
|
-
b4 = Newt::Button.new(-1, -1, "But what?")
|
16
|
-
|
17
|
-
f = Newt::Form.new
|
18
|
-
|
19
|
-
grid = Newt::Grid.new(2, 2)
|
20
|
-
grid.set_field(0, 0, Newt::GRID_COMPONENT, b1, 0, 0, 0, 0,
|
21
|
-
Newt::ANCHOR_RIGHT, 0)
|
22
|
-
grid.set_field(0, 1, Newt::GRID_COMPONENT, b2, 0, 0, 0, 0, 0, 0)
|
23
|
-
grid.set_field(1, 0, Newt::GRID_COMPONENT, b3, 0, 0, 0, 0, 0, 0)
|
24
|
-
grid.set_field(1, 1, Newt::GRID_COMPONENT, b4, 0, 0, 0, 0, 0, 0)
|
25
|
-
|
26
|
-
f.add(b1, b2, b3, b4)
|
27
|
-
|
28
|
-
grid.wrapped_window("first window")
|
29
|
-
|
30
|
-
answer = f.run()
|
31
|
-
|
32
|
-
#f.destroy()
|
33
|
-
Newt::Screen.pop_window()
|
34
|
-
|
35
|
-
flowedText, textWidth, textHeight = Newt.reflow_text("This is a quite a bit of text. It is 40 " +
|
36
|
-
"columns long, so some wrapping should be " +
|
37
|
-
"done. Did you know that the quick, brown " +
|
38
|
-
"fox jumped over the lazy dog?\n\n" +
|
39
|
-
"In other news, it's pretty important that we " +
|
40
|
-
"can properly force a line break.",
|
41
|
-
40, 5, 5)
|
42
|
-
t = Newt::Textbox.new(-1, -1, textWidth, textHeight, Newt::FLAG_WRAP)
|
43
|
-
t.set_text(flowedText)
|
44
|
-
|
45
|
-
|
46
|
-
b1 = Newt::Button.new(-1, -1, "Okay")
|
47
|
-
b2 = Newt::Button.new(-1, -1, "Cancel")
|
48
|
-
|
49
|
-
grid = Newt::Grid.new(1, 2)
|
50
|
-
subgrid = Newt::Grid.new(2, 1)
|
51
|
-
|
52
|
-
subgrid.set_field(0, 0, Newt::GRID_COMPONENT, b1, 0, 0, 0, 0, 0, 0)
|
53
|
-
subgrid.set_field(1, 0, Newt::GRID_COMPONENT, b2, 0, 0, 0, 0, 0, 0)
|
54
|
-
|
55
|
-
grid.set_field(0, 0, Newt::GRID_COMPONENT, t, 0, 0, 0, 1, 0, 0)
|
56
|
-
grid.set_field(0, 1, Newt::GRID_SUBGRID, subgrid, 0, 0, 0, 0, 0,
|
57
|
-
Newt::GRID_FLAG_GROWX)
|
58
|
-
grid.wrapped_window("another example")
|
59
|
-
|
60
|
-
f = Newt::Form.new
|
61
|
-
f.add(b1, t, b2)
|
62
|
-
#f.add(b1, b2)
|
63
|
-
answer = f.run()
|
64
|
-
|
65
|
-
Newt::Screen.pop_window()
|
66
|
-
#f.destroy()
|
67
|
-
|
68
|
-
Newt::Screen.win_message("Simple", "Ok", "This is a simple message window")
|
69
|
-
Newt::Screen.win_choice("Simple", "Ok", "Cancel", "This is a simple choice window")
|
70
|
-
|
71
|
-
textWidth = Newt::Screen.win_menu("Test Menu", "This is a sample invovation of the " +
|
72
|
-
"newtWinMenu() call. It may or may not have a scrollbar, " +
|
73
|
-
"depending on the need for one.", 50, 5, 5, 3,
|
74
|
-
menuContents, "Ok", "Cancel")
|
75
|
-
|
76
|
-
v = Newt::Screen.win_entries("Text newtWinEntries()", "This is a sample invovation of " +
|
77
|
-
"newtWinEntries() call. It lets you get a lot of input " +
|
78
|
-
"quite easily.", 50, 5, 5, 20, autoEntries, "Ok", "Cancel")
|
79
|
-
|
80
|
-
Newt::Screen.finish
|
81
|
-
|
82
|
-
printf "item = %d\n", textWidth
|
83
|
-
p v
|
data/examples/testtree-j.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
Newt::Screen.new
|
7
|
-
|
8
|
-
checktree = Newt::CheckboxTreeMulti.new(-1, -1, 10, " ab", Newt::FLAG_SCROLL)
|
9
|
-
checktree.add("¥Ê¥ó¥Ð¡¼", 2, 0, Newt::ARG_APPEND)
|
10
|
-
checktree.add("ËÜÅö¤ËËÜÅö¤ËŤ¤¥â¥Î", 3, 0, Newt::ARG_APPEND)
|
11
|
-
checktree.add("¥Ê¥ó¥Ð¡¼£µ", 5, Newt::FLAG_SELECTED, Newt::ARG_APPEND)
|
12
|
-
checktree.add("¥Ê¥ó¥Ð¡¼£¶", 6, 0, Newt::ARG_APPEND)
|
13
|
-
checktree.add("¥Ê¥ó¥Ð¡¼£·", 7, Newt::FLAG_SELECTED, Newt::ARG_APPEND)
|
14
|
-
checktree.add("¥Ê¥ó¥Ð¡¼£¸", 8, 0, Newt::ARG_APPEND)
|
15
|
-
checktree.add("¥Ê¥ó¥Ð¡¼£¹", 9, 0, Newt::ARG_APPEND)
|
16
|
-
checktree.add("¥Ê¥ó¥Ð¡¼£±£°", 10, Newt::FLAG_SELECTED, Newt::ARG_APPEND)
|
17
|
-
checktree.add("¥Ê¥ó¥Ð¡¼£±£±", 11, 0, Newt::ARG_APPEND)
|
18
|
-
checktree.add("¥Ê¥ó¥Ð¡¼£±£²", 12, Newt::FLAG_SELECTED, Newt::ARG_APPEND)
|
19
|
-
|
20
|
-
checktree.add("¥«¥é¡¼", 1, 0, 0)
|
21
|
-
checktree.add("ÀÖ¿§", 100, 0, 0, Newt::ARG_APPEND)
|
22
|
-
checktree.add("Çò¿§", 101, 0, 0, Newt::ARG_APPEND)
|
23
|
-
checktree.add("ÀÄ¿§", 102, 0, 0, Newt::ARG_APPEND)
|
24
|
-
|
25
|
-
checktree.add("¥Ê¥ó¥Ð¡¼£´", 4, 0, 3)
|
26
|
-
|
27
|
-
checktree.add("°ì·å¤Î¿ô»ú", 200, 0, 1, Newt::ARG_APPEND)
|
28
|
-
checktree.add("°ì", 201, 0, 1, 0, Newt::ARG_APPEND)
|
29
|
-
checktree.add("Æó", 202, 0, 1, 0, Newt::ARG_APPEND)
|
30
|
-
checktree.add("»°", 203, 0, 1, 0, Newt::ARG_APPEND)
|
31
|
-
checktree.add("»Í", 204, 0, 1, 0, Newt::ARG_APPEND)
|
32
|
-
|
33
|
-
checktree.add("Æó·å¤Î¿ô»ú", 300, 0, 1, Newt::ARG_APPEND)
|
34
|
-
checktree.add("½½", 210, 0, 1, 1, Newt::ARG_APPEND)
|
35
|
-
checktree.add("½½°ì", 211, 0, 1, 1, Newt::ARG_APPEND)
|
36
|
-
checktree.add("½½Æó", 212, 0, 1, 1, Newt::ARG_APPEND)
|
37
|
-
checktree.add("½½»°", 213, 0, 1, 1, Newt::ARG_APPEND)
|
38
|
-
|
39
|
-
button = Newt::Button.new(-1, -1, "½ªÎ»")
|
40
|
-
|
41
|
-
grid = Newt::Grid.new(1, 2)
|
42
|
-
grid.set_field(0, 0, Newt::GRID_COMPONENT, checktree, 0, 0, 0, 1,
|
43
|
-
Newt::ANCHOR_RIGHT, 0)
|
44
|
-
grid.set_field(0, 1, Newt::GRID_COMPONENT, button, 0, 0, 0, 0,
|
45
|
-
0, 0)
|
46
|
-
|
47
|
-
grid.wrapped_window("¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¥Ä¥ê¡¼¥Æ¥¹¥È")
|
48
|
-
|
49
|
-
form = Newt::Form.new
|
50
|
-
form.add(checktree, button)
|
51
|
-
|
52
|
-
answer = form.run()
|
53
|
-
|
54
|
-
Newt::Screen.finish
|
55
|
-
|
data/examples/testtree.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require "newt"
|
5
|
-
|
6
|
-
Newt::Screen.new
|
7
|
-
|
8
|
-
checktree = Newt::CheckboxTreeMulti.new(-1, -1, 10, " ab", Newt::FLAG_SCROLL)
|
9
|
-
checktree.add("Numbers", 2, 0, Newt::ARG_APPEND)
|
10
|
-
checktree.add("Really really long thing", 3, 0, Newt::ARG_APPEND)
|
11
|
-
checktree.add("number 5", 5, Newt::FLAG_SELECTED, Newt::ARG_APPEND)
|
12
|
-
checktree.add("number 6", 6, 0, Newt::ARG_APPEND)
|
13
|
-
checktree.add("number 7", 7, Newt::FLAG_SELECTED, Newt::ARG_APPEND)
|
14
|
-
checktree.add("number 8", 8, 0, Newt::ARG_APPEND)
|
15
|
-
checktree.add("number 9", 9, 0, Newt::ARG_APPEND)
|
16
|
-
checktree.add("number 10", 10, Newt::FLAG_SELECTED, Newt::ARG_APPEND)
|
17
|
-
checktree.add("number 11", 11, 0, Newt::ARG_APPEND)
|
18
|
-
checktree.add("number 12", 12, Newt::FLAG_SELECTED, Newt::ARG_APPEND)
|
19
|
-
|
20
|
-
checktree.add("Colors", 1, 0, 0)
|
21
|
-
checktree.add("Red", 100, 0, 0, Newt::ARG_APPEND)
|
22
|
-
checktree.add("White", 101, 0, 0, Newt::ARG_APPEND)
|
23
|
-
checktree.add("Blue", 102, 0, 0, Newt::ARG_APPEND)
|
24
|
-
|
25
|
-
checktree.add("number 4", 4, 0, 3)
|
26
|
-
|
27
|
-
checktree.add("Single digit", 200, 0, 1, Newt::ARG_APPEND)
|
28
|
-
checktree.add("One", 201, 0, 1, 0, Newt::ARG_APPEND)
|
29
|
-
checktree.add("Two", 202, 0, 1, 0, Newt::ARG_APPEND)
|
30
|
-
checktree.add("Three", 203, 0, 1, 0, Newt::ARG_APPEND)
|
31
|
-
checktree.add("Four", 204, 0, 1, 0, Newt::ARG_APPEND)
|
32
|
-
|
33
|
-
checktree.add("Double digit", 300, 0, 1, Newt::ARG_APPEND)
|
34
|
-
checktree.add("Ten", 210, 0, 1, 1, Newt::ARG_APPEND)
|
35
|
-
checktree.add("Eleven", 211, 0, 1, 1, Newt::ARG_APPEND)
|
36
|
-
checktree.add("Twelve", 212, 0, 1, 1, Newt::ARG_APPEND)
|
37
|
-
checktree.add("Thirteen", 213, 0, 1, 1, Newt::ARG_APPEND)
|
38
|
-
|
39
|
-
button = Newt::Button.new(-1, -1, "Exit")
|
40
|
-
|
41
|
-
grid = Newt::Grid.new(1, 2)
|
42
|
-
grid.set_field(0, 0, Newt::GRID_COMPONENT, checktree, 0, 0, 0, 1,
|
43
|
-
Newt::ANCHOR_RIGHT, 0)
|
44
|
-
grid.set_field(0, 1, Newt::GRID_COMPONENT, button, 0, 0, 0, 0,
|
45
|
-
0, 0)
|
46
|
-
|
47
|
-
grid.wrapped_window("Checkbox Tree Test")
|
48
|
-
|
49
|
-
form = Newt::Form.new
|
50
|
-
form.add(checktree, button)
|
51
|
-
|
52
|
-
answer = form.run()
|
53
|
-
|
54
|
-
Newt::Screen.finish
|
data/script/console
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# File: script/console
|
3
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
-
|
5
|
-
libs = " -r irb/completion"
|
6
|
-
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
-
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
-
libs << " -r #{File.dirname(__FILE__) + '/../lib/newt.rb'}"
|
9
|
-
puts "Loading newt gem"
|
10
|
-
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/destroy'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/generate'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Generate.new.run(ARGV)
|
@@ -1,43 +0,0 @@
|
|
1
|
-
namespace :extconf do
|
2
|
-
extension = File.basename(__FILE__, '.rake')
|
3
|
-
|
4
|
-
ext = "ext/#{extension}"
|
5
|
-
ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
|
6
|
-
ext_files = FileList[
|
7
|
-
"#{ext}/*.c",
|
8
|
-
"#{ext}/*.h",
|
9
|
-
"#{ext}/*.rl",
|
10
|
-
"#{ext}/extconf.rb",
|
11
|
-
"#{ext}/Makefile",
|
12
|
-
# "lib"
|
13
|
-
]
|
14
|
-
|
15
|
-
|
16
|
-
task :compile => extension do
|
17
|
-
if Dir.glob("**/#{extension}.{o,so,dll}").length == 0
|
18
|
-
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
19
|
-
STDERR.puts "Gem actually failed to build. Your system is"
|
20
|
-
STDERR.puts "NOT configured properly to build #{GEM_NAME}."
|
21
|
-
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
22
|
-
exit(1)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
desc "Builds just the #{extension} extension"
|
27
|
-
task extension.to_sym => ["#{ext}/Makefile", ext_so ]
|
28
|
-
|
29
|
-
file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
|
30
|
-
Dir.chdir(ext) do ruby "extconf.rb" end
|
31
|
-
end
|
32
|
-
|
33
|
-
file ext_so => ext_files do
|
34
|
-
Dir.chdir(ext) do
|
35
|
-
sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
|
36
|
-
if !ok
|
37
|
-
require "fileutils"
|
38
|
-
FileUtils.rm Dir.glob('*.{so,o,dll,bundle}')
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/tasks/extconf.rake
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
namespace :extconf do
|
2
|
-
desc "Compiles the Ruby extension"
|
3
|
-
task :compile
|
4
|
-
end
|
5
|
-
|
6
|
-
task :compile => "extconf:compile"
|
7
|
-
|
8
|
-
task :test => :compile
|
9
|
-
|
10
|
-
BIN = "*.{bundle,jar,so,obj,pdb,lib,def,exp}"
|
11
|
-
$hoe.clean_globs |= ["ext/**/#{BIN}", "lib/**/#{BIN}", 'ext/**/Makefile']
|
12
|
-
$hoe.spec.require_paths = Dir['{lib,ext/*}']
|
13
|
-
$hoe.spec.extensions = FileList["ext/**/extconf.rb"].to_a
|
data/test/test_helper.rb
DELETED
data/test/test_newt.rb
DELETED