ruby-iup 0.0.1-i386-mswin32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. data/doc/README +10 -0
  2. data/doc/build_install.txt +77 -0
  3. data/examples/README +16 -0
  4. data/examples/ctrl/cbox.rb +221 -0
  5. data/examples/ctrl/checkboard.rb +33 -0
  6. data/examples/ctrl/degrade.rb +73 -0
  7. data/examples/ctrl/example1.rb +53 -0
  8. data/examples/ctrl/example2.rb +39 -0
  9. data/examples/ctrl/iupcolorbar.rb +95 -0
  10. data/examples/ctrl/iupcolorbrowser.rb +45 -0
  11. data/examples/ctrl/iupdial.rb +117 -0
  12. data/examples/ctrl/iupgauge.rb +242 -0
  13. data/examples/ctrl/iupgetcolor.rb +8 -0
  14. data/examples/ctrl/iupgetparam.rb +62 -0
  15. data/examples/ctrl/iupglcanvas.rb +172 -0
  16. data/examples/ctrl/iupmask.rb +15 -0
  17. data/examples/ctrl/iupmatrix.rb +39 -0
  18. data/examples/ctrl/iupplot2.rb +603 -0
  19. data/examples/ctrl/iuptabs.rb +22 -0
  20. data/examples/ctrl/iuptree.rb +190 -0
  21. data/examples/ctrl/iupval.rb +71 -0
  22. data/examples/ctrl/numbering.rb +46 -0
  23. data/examples/ctrl/sample.rb +166 -0
  24. data/examples/dlg/iupalarm.rb +14 -0
  25. data/examples/dlg/iupfiledlg.rb +19 -0
  26. data/examples/dlg/iupgetfile.rb +19 -0
  27. data/examples/dlg/iuplistdialog.rb +26 -0
  28. data/examples/dlg/iupmessage.rb +5 -0
  29. data/examples/dlg/iupscanf.rb +17 -0
  30. data/examples/elem/iupbutton.rb +197 -0
  31. data/examples/elem/iupcanvas.rb +27 -0
  32. data/examples/elem/iupcanvas2.rb +113 -0
  33. data/examples/elem/iupcanvas3.rb +62 -0
  34. data/examples/elem/iupdialog.rb +71 -0
  35. data/examples/elem/iupdialog2.rb +25 -0
  36. data/examples/elem/iupfill.rb +51 -0
  37. data/examples/elem/iupframe.rb +25 -0
  38. data/examples/elem/iuphbox.rb +68 -0
  39. data/examples/elem/iupimage.rb +113 -0
  40. data/examples/elem/iupitem.rb +60 -0
  41. data/examples/elem/iuplabel.rb +57 -0
  42. data/examples/elem/iuplist.rb +41 -0
  43. data/examples/elem/iuplist2.rb +125 -0
  44. data/examples/elem/iupmenu.rb +32 -0
  45. data/examples/elem/iupmultiline.rb +24 -0
  46. data/examples/elem/iupmultiline2.rb +156 -0
  47. data/examples/elem/iupradio.rb +32 -0
  48. data/examples/elem/iupseparator.rb +81 -0
  49. data/examples/elem/iupsubmenu.rb +85 -0
  50. data/examples/elem/iuptext.rb +61 -0
  51. data/examples/elem/iuptimer.rb +36 -0
  52. data/examples/elem/iuptoggle.rb +110 -0
  53. data/examples/elem/iupvbox.rb +87 -0
  54. data/examples/elem/iupzbox.rb +60 -0
  55. data/examples/elem/mdisample.rb +376 -0
  56. data/examples/elem/progressbar.rb +294 -0
  57. data/examples/elem/scrollbar.rb +66 -0
  58. data/examples/elem/tray.rb +90 -0
  59. data/examples/func/iupgetattribute.rb +32 -0
  60. data/examples/func/iupidle.rb +48 -0
  61. data/ext/extconf.rb +27 -0
  62. data/ext/iup-win32/cd.dll +0 -0
  63. data/ext/iup-win32/cd.lib +0 -0
  64. data/ext/iup-win32/cdcontextplus.dll +0 -0
  65. data/ext/iup-win32/cdcontextplus.lib +0 -0
  66. data/ext/iup-win32/cdlua51.lib +0 -0
  67. data/ext/iup-win32/cdluacontextplus51.lib +0 -0
  68. data/ext/iup-win32/cdluaim51.lib +0 -0
  69. data/ext/iup-win32/cdluapdf51.lib +0 -0
  70. data/ext/iup-win32/cdpdf.dll +0 -0
  71. data/ext/iup-win32/cdpdf.lib +0 -0
  72. data/ext/iup-win32/freetype6.dll +0 -0
  73. data/ext/iup-win32/freetype6.lib +0 -0
  74. data/ext/iup-win32/im.dll +0 -0
  75. data/ext/iup-win32/im_avi.dll +0 -0
  76. data/ext/iup-win32/im_capture.dll +0 -0
  77. data/ext/iup-win32/im_ecw.dll +0 -0
  78. data/ext/iup-win32/im_fftw.dll +0 -0
  79. data/ext/iup-win32/im_jp2.dll +0 -0
  80. data/ext/iup-win32/im_process.dll +0 -0
  81. data/ext/iup-win32/im_wmv.dll +0 -0
  82. data/ext/iup-win32/iup.dll +0 -0
  83. data/ext/iup-win32/iup.lib +0 -0
  84. data/ext/iup-win32/iup_pplot.dll +0 -0
  85. data/ext/iup-win32/iup_pplot.lib +0 -0
  86. data/ext/iup-win32/iupcd.dll +0 -0
  87. data/ext/iup-win32/iupcd.lib +0 -0
  88. data/ext/iup-win32/iupcontrols.dll +0 -0
  89. data/ext/iup-win32/iupcontrols.lib +0 -0
  90. data/ext/iup-win32/iupgl.dll +0 -0
  91. data/ext/iup-win32/iupgl.lib +0 -0
  92. data/ext/iup-win32/iupim.dll +0 -0
  93. data/ext/iup-win32/iupim.lib +0 -0
  94. data/ext/iup-win32/iupimglib.dll +0 -0
  95. data/ext/iup-win32/iupimglib.lib +0 -0
  96. data/ext/iup-win32/iuplua51.lib +0 -0
  97. data/ext/iup-win32/iuplua_pplot51.lib +0 -0
  98. data/ext/iup-win32/iupluacd51.lib +0 -0
  99. data/ext/iup-win32/iupluacontrols51.lib +0 -0
  100. data/ext/iup-win32/iupluagl51.lib +0 -0
  101. data/ext/iup-win32/iupluaim51.lib +0 -0
  102. data/ext/iup-win32/iupluaimglib51.lib +0 -0
  103. data/ext/iup-win32/iupluaole51.lib +0 -0
  104. data/ext/iup-win32/iupole.dll +0 -0
  105. data/ext/iup-win32/iupole.lib +0 -0
  106. data/ext/iup-win32/iupstub.lib +0 -0
  107. data/ext/iup-win32/pdflib.dll +0 -0
  108. data/ext/iup-win32/pdflib.lib +0 -0
  109. data/ext/iup.c +1261 -0
  110. data/ext/mkrf_conf.rb +72 -0
  111. data/ext/rb_cd.h +1525 -0
  112. data/ext/rb_iup.h +2446 -0
  113. data/ext/rb_iup_pplot.h +129 -0
  114. data/ext/rb_iupcb.h +13 -0
  115. data/ext/rb_iupcbox.h +40 -0
  116. data/ext/rb_iupcells.h +15 -0
  117. data/ext/rb_iupcolorbar.h +17 -0
  118. data/ext/rb_iupcompat.h +237 -0
  119. data/ext/rb_iupcontrols.h +28 -0
  120. data/ext/rb_iupdef.h +3 -0
  121. data/ext/rb_iupdial.h +24 -0
  122. data/ext/rb_iupgauge.h +15 -0
  123. data/ext/rb_iupgc.h +18 -0
  124. data/ext/rb_iupgetparam.h +72 -0
  125. data/ext/rb_iupgl.h +58 -0
  126. data/ext/rb_iupim.h +25 -0
  127. data/ext/rb_iupmask.h +189 -0
  128. data/ext/rb_iupmatrix.h +80 -0
  129. data/ext/rb_iupole.h +24 -0
  130. data/ext/rb_iupsbox.h +23 -0
  131. data/ext/rb_iupspeech.h +25 -0
  132. data/ext/rb_iupspin.h +29 -0
  133. data/ext/rb_iuptabs.h +29 -0
  134. data/ext/rb_iuptree.h +94 -0
  135. data/ext/rb_iupval.h +24 -0
  136. data/lib/README +1 -0
  137. data/lib/iup.so +0 -0
  138. metadata +187 -0
data/doc/README ADDED
@@ -0,0 +1,10 @@
1
+ ruby-opengl tests
2
+ =================
3
+
4
+ This directory contains the unit tests for ruby-opengl. You should be able
5
+ to run the test by calling 'rake test' from installation root directory.
6
+
7
+ Note that the tests are meant for purposes of internal development, and depending on
8
+ your system configuration may not run at all - the purpose is to test the
9
+ bindings, not the underlying OpenGL implementation.
10
+
@@ -0,0 +1,77 @@
1
+ Building ruby-iup
2
+ ====================
3
+
4
+ Pre-requisites
5
+ --------------
6
+
7
+ General
8
+ --------------
9
+ * C compiler (not needed for binary install on Windows)
10
+ * ruby 1.8.5+ or ruby 1.9.0+
11
+ * rake
12
+ * mkrf 0.2.0+ (0.2.3+ for ruby 1.9)
13
+ * rubygems 0.9.1+
14
+ * IUP 2.7+ header and library (not needed for binary install on Windows)
15
+ * CD 5.1+ header and library (not needed for binary install on Windows)
16
+ * IM 3.4+ header and library (not needed for binary install on Windows)
17
+
18
+
19
+ Linux
20
+ --------------
21
+ On Ubuntu or Debian systems, aside from Ruby you'll need ruby and
22
+ some extra ruby related packages:
23
+
24
+ * `ruby rdoc ri ruby1.8-dev`
25
+
26
+ On older Gentoo, Debian and Ubuntu, rubygems 0.9.0 will be installed by default
27
+ in the packages. This version of rubygems is INCOMPATIBLE with ruby-iup.
28
+ You'll need to install rubygems 0.9.1+ from source.
29
+
30
+ On some distributions you may need 'xorg-dev' developer package.
31
+
32
+
33
+
34
+ Build and installation
35
+ --------------
36
+
37
+ Installing from rubygems
38
+ -------------------
39
+
40
+ Runnig 'gem install -y ruby-iup' and it should pull down the gem
41
+ and try to build the bindings for you automatically.
42
+
43
+ For windows there is also pre-built binary windows gem available
44
+ (i386-mswin32) which is compatible with the ruby one-click installer and does not need
45
+ compiler or other mentioned tools installed.
46
+
47
+ Manual Build instructions for all platforms (see above for platform-specific notes)
48
+ ------------------
49
+ 1. Make sure you have working ruby with rubygems installed
50
+ and (if needed) appropriate developer packages (ruby-dev,ruby1.8-dev,...).
51
+ 2. Make sure you have working C compiler
52
+ 3. Install rake either from package or by running 'gem install rake'
53
+ 4. Install mkrf (0.2.0+) either from package or by running 'gem install mkrf'
54
+ 5. Run 'rake' at the top level of the project
55
+
56
+ Installing manually built extensions
57
+ ------------------
58
+ 1. Run 'rake clean' to clean out the project
59
+ 2. Run 'rake gem' to create source gem from project
60
+ 3. Run 'gem install pkg/ruby-iup-(version).gem' to compile and install the gem
61
+ 4. Done.
62
+
63
+ Building binary gem (useful only for binary distribution of the project)
64
+ ------------------
65
+ 1. Run 'gem install gembuilder' to install the gembuilder package
66
+ 2. Run 'rake clean' to clean out the project
67
+ 3. Run 'rake gem' to build source gem
68
+ 4. Run 'gembuilder pkg/ruby-iup-(version).gem' to compile the binary gem
69
+
70
+
71
+
72
+ Running programs and examples
73
+ -----------------
74
+ To run a sample file, make sure the ruby-iup gem is installed then:
75
+
76
+ $ cd examples
77
+ $ ruby sample.rb
data/examples/README ADDED
@@ -0,0 +1,16 @@
1
+ Examples
2
+ ========
3
+
4
+ This directory contains OpenGL examples converted to ruby from various sources.
5
+ As such, they are distributed under various terms - see each file for licensing info.
6
+
7
+ RedBook/
8
+ Examples from OpenGL Red Book and SGI's example code in general, licensed under
9
+ SGI open-source license.
10
+ OrangeBook/
11
+ Examples from OpenGL Orange Book (GLSL), distributed under BSD license
12
+ NeHe/
13
+ NeHe's opengl tutorials (http://nehe.gamedev.net), licensed under free license.
14
+ Misc/
15
+ Other examples. If license is not given, MIT is assumed.
16
+
@@ -0,0 +1,221 @@
1
+ require 'rubygems'
2
+ require 'iup'
3
+
4
+ class IupCboxTest
5
+ def create_mat()
6
+ mat = Iup.Matrix()
7
+
8
+ mat["numcol"] = 1
9
+ mat["numlin"] = 3
10
+ mat["numcol_visible"] = 1
11
+ mat["numlin_visible"] = 3
12
+ mat["expand"] = "NO"
13
+ mat["scrollbar"] = "NO"
14
+
15
+ mat["0:0"] = "Inflation"
16
+ mat["1:0"] = "Medicine "
17
+ mat["2:0"] = "Food"
18
+ mat["3:0"] = "Energy"
19
+ mat["0:1"] = "January 2000"
20
+ mat["1:1"] = 5.6
21
+ mat["2:1"] = 2.2
22
+ mat["3:1"] = 7.2
23
+
24
+ mat["bgcolor"] = "255 255 255"
25
+ mat["bgcolor1:0"] = "255 128 0"
26
+ mat["bgcolor2:1"] = "255 128 0"
27
+ mat["fgcolor2:0"] = "255 0 128"
28
+ mat["fgcolor1:1"] = "255 0 128"
29
+
30
+ mat["cx"] = 600
31
+ mat["cy"] = 250
32
+ return mat
33
+ end
34
+
35
+ def createtree()
36
+ tree = Iup.Tree(:attr=>"FONT=COURIER_NORMAL_10, "+
37
+ "NAME=Figures, "+
38
+ "ADDBRANCH=3D, "+
39
+ "ADDBRANCH=2D, "+
40
+ "ADDLEAF1=trapeze, "+
41
+ "ADDBRANCH1=parallelogram, "+
42
+ "ADDLEAF2=diamond, "+
43
+ "ADDLEAF2=square, "+
44
+ "ADDBRANCH4=triangle, "+
45
+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,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
119
+ 2,2,2,2,2,2,2,3,3,3,3,3,3,3,1,1,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,
120
+ 2,2,2,2,2,2,3,3,3,3,3,3,3,3,1,1,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,
121
+ 2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,
122
+ 2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
123
+ 2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
124
+ 2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
125
+ 2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
126
+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
127
+
128
+ @img1 = Iup.Image(32,32, @img_bits1)
129
+ @img1["0"] = "0 0 0"
130
+ @img1["1"] = "BGCOLOR"
131
+ @img1["2"] = "255 0 0"
132
+
133
+ @img2 = Iup.Image(32,32, @img_bits2)
134
+ @img2["0"] = "0 0 0"
135
+ @img2["1"] = "0 255 0"
136
+ @img2["2"] = "BGCOLOR"
137
+ @img2["3"] = "255 0 0"
138
+
139
+ _frm_1 = Iup.Frame(
140
+ Iup.Vbox([
141
+ Iup.Button(:title=>"Button Text",:cindex=>"1"),
142
+ Iup.Button(:title=>"",:image=>@img1,:cindex=>"2"),
143
+ Iup.Button(:title=>"",:image=>@img2,:cindex=>"3")
144
+ ]),:title=>"IupButton",:cx=>10,:cy=>180)
145
+
146
+ _frm_2 = Iup.Frame(
147
+ Iup.Vbox([
148
+ Iup.Label(:title=>"Label Text",:cindex => 1),
149
+ Iup.Label(:title=>"",:separator => 'HORIZONTAL',:cindex => 2),
150
+ Iup.Label(:title=>"",:image => @img1,:cindex => 3)
151
+ ]),:title=>"IupLabel",:cx=>200,:cy=>250)
152
+
153
+ _frm_3 = Iup.Frame(
154
+ Iup.Vbox([
155
+ Iup.Toggle(:title=>"Toggle Text", :value => 'ON',:cindex => 1),
156
+ Iup.Toggle(:title=>"",:image => @img1,:impress => @img2,:cindex => 2),
157
+ Iup.Frame(Iup.Radio(Iup.Vbox([
158
+ Iup.Toggle(:title=>"Toggle Text",:cindex =>3),
159
+ Iup.Toggle(:title=>"Toggle Text",:cindex =>4)
160
+ ])),:title => "IupRadio")
161
+ ]),:title=>"IupToggle",:cx=>400,:cy=>250)
162
+
163
+ _text_1 = Iup.Text(:value=>"IupText Text",:size=>'80x',:cindex=>1,:cx=>10,:cy=>100)
164
+
165
+ _ml_1 = Iup.MultiLine(:value=>"IupMultiline Text\nSecond Line\nThird Line",
166
+ :size=>'80x60',:cindex=>1,:cx=>200,:cy=>100)
167
+
168
+ _list_1 = Iup.List(:value=>1,:cindex=>1,:cx=>10,:cy=>10)
169
+ _list_1["1"] = "Item 1 Text"
170
+ _list_1["2"] = "Item 2 Text"
171
+ _list_1["3"] = "Item 3 Text"
172
+
173
+ _list_2 = Iup.List(:dropdown=>'YES',:value=>2,:cindex=>2,:cx=>200,:cy=>10)
174
+ _list_2["1"] = "Item 1 Text"
175
+ _list_2["2"] = "Item 2 Text"
176
+ _list_2["3"] = "Item 3 Text"
177
+
178
+ _list_3 = Iup.List(:editbox=>'YES',:value=>3,:cindex=>3,:cx=>400,:cy=>10)
179
+ _list_3["1"] = "Item 1 Text"
180
+ _list_3["2"] = "Item 2 Text"
181
+ _list_3["3"] = "Item 3 Text"
182
+
183
+ _cnv_1 = Iup.Canvas(:action=>"do_nothing",:rastersize=>'100x100',:posx=>0.0,:posy=>0.0,
184
+ :bgcolor=>'128 255 0',:cx=>400,:cy=>100)
185
+
186
+ _ctrl_1 = Iup.Val(:cx=>600,:cy=>200)
187
+
188
+ _cbox = Iup.Cbox([
189
+ _text_1,
190
+ _ml_1,
191
+ _list_1,
192
+ _list_2,
193
+ _list_3,
194
+ _cnv_1,
195
+ _ctrl_1,
196
+ createtree(),
197
+ create_mat(),
198
+ _frm_1,
199
+ _frm_2,
200
+ _frm_3
201
+ ],:size=>"680x250")
202
+
203
+ hbox = Iup.Hbox([Iup.Fill(:size=>10),
204
+ Iup.Vbox([Iup.Fill(:size=>10), _cbox])])
205
+
206
+ @dlg = Iup.Dialog(hbox,:title=>"Cbox Test")
207
+ end
208
+
209
+ def initialize
210
+ func_1()
211
+ @dlg.ShowXY(Iup::CENTER,Iup::CENTER)
212
+ Iup.MainLoop
213
+ @img1.Destroy
214
+ @img2.Destroy
215
+ @dlg.Destroy
216
+ end
217
+ end
218
+
219
+ test = IupCboxTest.new
220
+
221
+
@@ -0,0 +1,33 @@
1
+ require 'rubygems'
2
+ require 'iup'
3
+
4
+
5
+ def create()
6
+ cells = Iup.Cells()
7
+
8
+ cells.draw_cb = lambda {|h,i,j,xmin,xmax,ymin,ymax,cnv|
9
+ if (((i%2)!=0 && (j%2)!=0) || (((i+1)%2)!=0 && ((j+1)%2)!=0))
10
+ cnv.CanvasSetForeground(Cd::WHITE)
11
+ else
12
+ cnv.CanvasSetForeground(Cd::BLACK)
13
+ end
14
+ cnv.CanvasBox(xmin, xmax, ymin, ymax)
15
+
16
+ Iup::DEFAULT
17
+ }
18
+ cells.width_cb = lambda {|h,j| 50 }
19
+ cells.height_cb = lambda {|h,i| 50 }
20
+ cells.nlines_cb = lambda {|h| 8 }
21
+ cells.ncols_cb = lambda {|h| 8 }
22
+
23
+ return cells
24
+ end
25
+
26
+
27
+ cells = create()
28
+ dlg = Iup.Dialog(cells,:rastersize=>"400x400",:title=>"IupCells")
29
+
30
+ dlg.ShowXY(Iup::CENTER,Iup::CENTER)
31
+ Iup.MainLoop
32
+ dlg.Destroy
33
+
@@ -0,0 +1,73 @@
1
+ require 'rubygems'
2
+ require 'iup'
3
+
4
+
5
+ def create()
6
+ cells = Iup.Cells()
7
+ cells.mouseclick_cb = lambda {|h,b,m,i,j,x,y,r|
8
+ puts("CLICK: #{b}: (#{i}, #{j})")
9
+ Iup::DEFAULT
10
+ }
11
+ cells.draw_cb = lambda {|h,i,j,xmin,xmax,ymin,ymax,cnv|
12
+ xm = (xmax + xmin) / 2
13
+ ym = (ymax + ymin) / 2
14
+ buffer = 0.chr * 64
15
+
16
+ return Iup::DEFAULT if (i == 1 && j == 2)
17
+ return Iup::DEFAULT if (i == 2 && j == 1)
18
+ return Iup::DEFAULT if (i == 2 && j == 2)
19
+ return Iup::DEFAULT if (i == 5 && j == 6)
20
+ return Iup::DEFAULT if (i == 6 && j == 5)
21
+ return Iup::DEFAULT if (i == 6 && j == 6)
22
+
23
+ if (i == 1 && j == 1)
24
+ cnv.CanvasSetForeground(Cd::WHITE)
25
+ else
26
+ cnv.CanvasSetForeground(Cd.EncodeColor(
27
+ (i*20),(j*100),(i+100)))
28
+ end
29
+ cnv.CanvasBox(xmin, xmax, ymin, ymax)
30
+ cnv.CanvasTextAlignment(Cd::CENTER)
31
+ cnv.CanvasSetForeground(Cd::BLACK)
32
+ buffer = "(#{i}, #{j})"
33
+ cnv.CanvasText( xm, ym, buffer)
34
+
35
+ Iup::DEFAULT
36
+ }
37
+ cells.width_cb = lambda {|h,j| (50+j*1.5).to_i }
38
+ cells.height_cb = lambda {|h,i| (30+i*1.5).to_i }
39
+ cells.nlines_cb = lambda {|h| 7 }
40
+ cells.ncols_cb = lambda {|h| 7 }
41
+ cells.hspan_cb = lambda {|h,i,j|
42
+ return 2 if (i == 1 && j == 1)
43
+ return 2 if (i == 5 && j == 5)
44
+ 1
45
+ }
46
+ cells.vspan_cb = lambda {|h,i,j|
47
+ return 2 if (i == 1 && j == 1)
48
+ return 2 if (i == 5 && j == 5)
49
+ 1
50
+ }
51
+ cells.scroll_cb = lambda {|h,i,j|
52
+ puts("SCROLL: (#{i}, #{j})");
53
+ Iup::DEFAULT
54
+ }
55
+ cells.boxed = 'NO'
56
+ cells.rastersize = "395x255"
57
+
58
+ return cells
59
+ end
60
+
61
+ cells = create()
62
+ box = Iup.Vbox([cells])
63
+ box.margin = "10x10"
64
+
65
+ dlg = Iup.Dialog(box)
66
+ dlg.title = "IupCells"
67
+ dlg.ShowXY(Iup::CENTER,Iup::CENTER)
68
+ Iup.MainLoop
69
+ dlg.Destroy
70
+
71
+
72
+
73
+
@@ -0,0 +1,53 @@
1
+ require 'rubygems'
2
+ require 'iup'
3
+
4
+ img_bits1 = [
5
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,
6
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,
7
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,
8
+ 1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,
9
+ 1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,
10
+ 1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,
11
+ 1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,
12
+ 1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,
13
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
14
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,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1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,
30
+ 1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,
31
+ 1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,
32
+ 1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
33
+ 1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
34
+ 1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
35
+ 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
36
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
37
+ ]
38
+
39
+
40
+ bt = Iup.Button(:title=>"Test",:expand=>'YES')
41
+ box = Iup.Sbox(:elem=>bt,:direction=>'SOUTH',:color=>'0 0 255')
42
+
43
+ ml = Iup.MultiLine(:expand=>'YES')
44
+ vbox = Iup.Vbox([box, ml])
45
+
46
+ lb = Iup.Label(:title=>"Label",:expand=>'YES')
47
+ dg = Iup.Dialog(Iup.Hbox([vbox, lb]))
48
+
49
+ dg.Show
50
+
51
+ Iup.MainLoop
52
+ dg.Destroy
53
+