wxruby64 2.0.1-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. checksums.yaml +7 -0
  2. data/INSTALL +254 -0
  3. data/LICENSE +53 -0
  4. data/README +198 -0
  5. data/art/wxruby-128x128.png +0 -0
  6. data/art/wxruby-256x256.png +0 -0
  7. data/art/wxruby-64x64.png +0 -0
  8. data/art/wxruby.png +0 -0
  9. data/lib/wx.rb +53 -0
  10. data/lib/wx/accessors.rb +68 -0
  11. data/lib/wx/classes/acceleratortable.rb +28 -0
  12. data/lib/wx/classes/animation.rb +18 -0
  13. data/lib/wx/classes/app.rb +51 -0
  14. data/lib/wx/classes/artprovider.rb +31 -0
  15. data/lib/wx/classes/auinotebook.rb +9 -0
  16. data/lib/wx/classes/bitmap.rb +59 -0
  17. data/lib/wx/classes/busycursor.rb +12 -0
  18. data/lib/wx/classes/checklistbox.rb +46 -0
  19. data/lib/wx/classes/choice.rb +4 -0
  20. data/lib/wx/classes/clientdc.rb +13 -0
  21. data/lib/wx/classes/clipboard.rb +56 -0
  22. data/lib/wx/classes/colour.rb +49 -0
  23. data/lib/wx/classes/combobox.rb +4 -0
  24. data/lib/wx/classes/commandevent.rb +7 -0
  25. data/lib/wx/classes/controlwithitems.rb +10 -0
  26. data/lib/wx/classes/data_object.rb +14 -0
  27. data/lib/wx/classes/data_object_simple.rb +6 -0
  28. data/lib/wx/classes/dataformat.rb +23 -0
  29. data/lib/wx/classes/dc.rb +57 -0
  30. data/lib/wx/classes/event.rb +5 -0
  31. data/lib/wx/classes/evthandler.rb +1039 -0
  32. data/lib/wx/classes/font.rb +118 -0
  33. data/lib/wx/classes/functions.rb +44 -0
  34. data/lib/wx/classes/gauge.rb +12 -0
  35. data/lib/wx/classes/genericdirctrl.rb +36 -0
  36. data/lib/wx/classes/grid.rb +146 -0
  37. data/lib/wx/classes/hboxsizer.rb +6 -0
  38. data/lib/wx/classes/helpcontroller.rb +5 -0
  39. data/lib/wx/classes/helpcontrollerhelpprovider.rb +23 -0
  40. data/lib/wx/classes/helpprovider.rb +15 -0
  41. data/lib/wx/classes/htmlhelpcontroller.rb +5 -0
  42. data/lib/wx/classes/htmlwindow.rb +14 -0
  43. data/lib/wx/classes/icon.rb +32 -0
  44. data/lib/wx/classes/iconbundle.rb +3 -0
  45. data/lib/wx/classes/image.rb +53 -0
  46. data/lib/wx/classes/imagelist.rb +3 -0
  47. data/lib/wx/classes/listbox.rb +4 -0
  48. data/lib/wx/classes/listctrl.rb +33 -0
  49. data/lib/wx/classes/locale.rb +28 -0
  50. data/lib/wx/classes/mediactrl.rb +48 -0
  51. data/lib/wx/classes/menu.rb +62 -0
  52. data/lib/wx/classes/menuitem.rb +7 -0
  53. data/lib/wx/classes/notebook.rb +9 -0
  54. data/lib/wx/classes/object.rb +14 -0
  55. data/lib/wx/classes/paintdc.rb +12 -0
  56. data/lib/wx/classes/point.rb +56 -0
  57. data/lib/wx/classes/previewframe.rb +13 -0
  58. data/lib/wx/classes/rect.rb +19 -0
  59. data/lib/wx/classes/richtextctrl.rb +63 -0
  60. data/lib/wx/classes/simplehelpprovider.rb +38 -0
  61. data/lib/wx/classes/size.rb +58 -0
  62. data/lib/wx/classes/sizer.rb +43 -0
  63. data/lib/wx/classes/sound.rb +23 -0
  64. data/lib/wx/classes/splitterwindow.rb +10 -0
  65. data/lib/wx/classes/standardpaths.rb +9 -0
  66. data/lib/wx/classes/styledtextctrl.rb +92 -0
  67. data/lib/wx/classes/textctrl.rb +14 -0
  68. data/lib/wx/classes/texturlevent.rb +18 -0
  69. data/lib/wx/classes/timer.rb +96 -0
  70. data/lib/wx/classes/toolbar.rb +36 -0
  71. data/lib/wx/classes/toolbartool.rb +4 -0
  72. data/lib/wx/classes/treectrl.rb +44 -0
  73. data/lib/wx/classes/validator.rb +7 -0
  74. data/lib/wx/classes/vboxsizer.rb +6 -0
  75. data/lib/wx/classes/window.rb +89 -0
  76. data/lib/wx/classes/xmlresource.rb +54 -0
  77. data/lib/wx/helpers.rb +54 -0
  78. data/lib/wx/keyword_ctors.rb +204 -0
  79. data/lib/wx/keyword_defs.rb +585 -0
  80. data/lib/wx/version.rb +3 -0
  81. data/lib/wxruby2.so +0 -0
  82. data/samples/SAMPLES-LICENSE.TXT +18 -0
  83. data/samples/aui/aui.rb +1356 -0
  84. data/samples/bigdemo/About.rbw +39 -0
  85. data/samples/bigdemo/ColorPanel.rbw +23 -0
  86. data/samples/bigdemo/GridSimple.rbw +78 -0
  87. data/samples/bigdemo/MDIDemo.rbw +57 -0
  88. data/samples/bigdemo/PopupMenu.rbw +149 -0
  89. data/samples/bigdemo/ShapedWindow.rbw +128 -0
  90. data/samples/bigdemo/Sizers.rbw +543 -0
  91. data/samples/bigdemo/bigdemo.rb +823 -0
  92. data/samples/bigdemo/demoTemplate.rbw +33 -0
  93. data/samples/bigdemo/helpfile.htb +0 -0
  94. data/samples/bigdemo/icons/Test 015.jpg +0 -0
  95. data/samples/bigdemo/icons/Test 015.png +0 -0
  96. data/samples/bigdemo/icons/choice.bmp +0 -0
  97. data/samples/bigdemo/icons/choice.xpm +27 -0
  98. data/samples/bigdemo/icons/combo.bmp +0 -0
  99. data/samples/bigdemo/icons/combo.xpm +27 -0
  100. data/samples/bigdemo/icons/copy.xpm +25 -0
  101. data/samples/bigdemo/icons/cut.xpm +24 -0
  102. data/samples/bigdemo/icons/gauge.bmp +0 -0
  103. data/samples/bigdemo/icons/gauge.xpm +27 -0
  104. data/samples/bigdemo/icons/help.xpm +25 -0
  105. data/samples/bigdemo/icons/list.bmp +0 -0
  106. data/samples/bigdemo/icons/list.xpm +27 -0
  107. data/samples/bigdemo/icons/mondrian.ico +0 -0
  108. data/samples/bigdemo/icons/mondrian.xpm +44 -0
  109. data/samples/bigdemo/icons/new.xpm +24 -0
  110. data/samples/bigdemo/icons/ogl.ico +0 -0
  111. data/samples/bigdemo/icons/ogl.xpm +45 -0
  112. data/samples/bigdemo/icons/open.xpm +26 -0
  113. data/samples/bigdemo/icons/paste.bmp +0 -0
  114. data/samples/bigdemo/icons/paste.xpm +38 -0
  115. data/samples/bigdemo/icons/pointy.png +0 -0
  116. data/samples/bigdemo/icons/preview.xpm +26 -0
  117. data/samples/bigdemo/icons/print.xpm +26 -0
  118. data/samples/bigdemo/icons/radio.bmp +0 -0
  119. data/samples/bigdemo/icons/radio.xpm +27 -0
  120. data/samples/bigdemo/icons/robert.xpm +415 -0
  121. data/samples/bigdemo/icons/sashtest.ico +0 -0
  122. data/samples/bigdemo/icons/save.xpm +25 -0
  123. data/samples/bigdemo/icons/smiles.bmp +0 -0
  124. data/samples/bigdemo/icons/smiles.xpm +39 -0
  125. data/samples/bigdemo/icons/smiley.ico +0 -0
  126. data/samples/bigdemo/icons/smiley.xpm +42 -0
  127. data/samples/bigdemo/icons/stattext.xpm +24 -0
  128. data/samples/bigdemo/icons/test2.bmp +0 -0
  129. data/samples/bigdemo/icons/test2.png +0 -0
  130. data/samples/bigdemo/icons/test2.xpm +79 -0
  131. data/samples/bigdemo/icons/text.bmp +0 -0
  132. data/samples/bigdemo/icons/text.xpm +27 -0
  133. data/samples/bigdemo/icons/tog1.bmp +0 -0
  134. data/samples/bigdemo/icons/tog1.xpm +38 -0
  135. data/samples/bigdemo/icons/tog2.bmp +0 -0
  136. data/samples/bigdemo/icons/tog2.xpm +38 -0
  137. data/samples/bigdemo/icons/wxruby-128x128.png +0 -0
  138. data/samples/bigdemo/icons/wxwin.ico +0 -0
  139. data/samples/bigdemo/icons/wxwin16x16.png +0 -0
  140. data/samples/bigdemo/icons/wxwin16x16.xpm +25 -0
  141. data/samples/bigdemo/icons/wxwin32x32.png +0 -0
  142. data/samples/bigdemo/icons/wxwin48x48.png +0 -0
  143. data/samples/bigdemo/run.rb +90 -0
  144. data/samples/bigdemo/tips.txt +7 -0
  145. data/samples/bigdemo/utils.rb +12 -0
  146. data/samples/bigdemo/wxArtProvider.rbw +281 -0
  147. data/samples/bigdemo/wxBitmapButton.rbw +65 -0
  148. data/samples/bigdemo/wxButton.rbw +64 -0
  149. data/samples/bigdemo/wxCalendarCtrl.rbw +60 -0
  150. data/samples/bigdemo/wxCheckBox.rbw +50 -0
  151. data/samples/bigdemo/wxCheckListBox.rbw +65 -0
  152. data/samples/bigdemo/wxChoice.rbw +47 -0
  153. data/samples/bigdemo/wxChoicebook.rbw +78 -0
  154. data/samples/bigdemo/wxColourDialog.rbw +31 -0
  155. data/samples/bigdemo/wxComboBox.rbw +77 -0
  156. data/samples/bigdemo/wxCursor.rbw +136 -0
  157. data/samples/bigdemo/wxDialog.rbw +74 -0
  158. data/samples/bigdemo/wxDirDialog.rbw +29 -0
  159. data/samples/bigdemo/wxDragImage.rbw +70 -0
  160. data/samples/bigdemo/wxFileDialog.rbw +37 -0
  161. data/samples/bigdemo/wxFileDialog_Save.rbw +35 -0
  162. data/samples/bigdemo/wxFindReplaceDialog.rbw +82 -0
  163. data/samples/bigdemo/wxFontDialog.rbw +173 -0
  164. data/samples/bigdemo/wxFrame.rbw +53 -0
  165. data/samples/bigdemo/wxGauge.rbw +71 -0
  166. data/samples/bigdemo/wxGenericDirCtrl.rbw +74 -0
  167. data/samples/bigdemo/wxGrid.rbw +66 -0
  168. data/samples/bigdemo/wxHtmlHelpController.rbw +52 -0
  169. data/samples/bigdemo/wxListBox.rbw +140 -0
  170. data/samples/bigdemo/wxListCtrl_virtual.rbw +112 -0
  171. data/samples/bigdemo/wxMDIWindows.rbw +50 -0
  172. data/samples/bigdemo/wxMenu.rbw +236 -0
  173. data/samples/bigdemo/wxMessageDialog.rbw +27 -0
  174. data/samples/bigdemo/wxMiniFrame.rbw +70 -0
  175. data/samples/bigdemo/wxMultipleChoiceDialog.rbw +32 -0
  176. data/samples/bigdemo/wxNotebook.rbw +136 -0
  177. data/samples/bigdemo/wxProgressDialog.rbw +43 -0
  178. data/samples/bigdemo/wxRadioBox.rbw +72 -0
  179. data/samples/bigdemo/wxRadioButton.rbw +125 -0
  180. data/samples/bigdemo/wxSashWindow.rbw +141 -0
  181. data/samples/bigdemo/wxScrolledMessageDialog.rbw +57 -0
  182. data/samples/bigdemo/wxScrolledWindow.rbw +199 -0
  183. data/samples/bigdemo/wxSingleChoiceDialog.rbw +33 -0
  184. data/samples/bigdemo/wxSlider.rbw +42 -0
  185. data/samples/bigdemo/wxSpinButton.rbw +50 -0
  186. data/samples/bigdemo/wxSpinCtrl.rbw +51 -0
  187. data/samples/bigdemo/wxSplitterWindow.rbw +63 -0
  188. data/samples/bigdemo/wxStaticBitmap.rbw +47 -0
  189. data/samples/bigdemo/wxStaticText.rbw +55 -0
  190. data/samples/bigdemo/wxStatusBar.rbw +126 -0
  191. data/samples/bigdemo/wxTextCtrl.rbw +149 -0
  192. data/samples/bigdemo/wxTextEntryDialog.rbw +31 -0
  193. data/samples/bigdemo/wxToggleButton.rbw +49 -0
  194. data/samples/bigdemo/wxToolBar.rbw +131 -0
  195. data/samples/bigdemo/wxTreeCtrl.rbw +191 -0
  196. data/samples/calendar/calendar.rb +348 -0
  197. data/samples/caret/caret.rb +282 -0
  198. data/samples/caret/mondrian.xpm +44 -0
  199. data/samples/controls/controls.rb +1136 -0
  200. data/samples/controls/get_item_sample.rb +87 -0
  201. data/samples/controls/icons/choice.xpm +27 -0
  202. data/samples/controls/icons/combo.xpm +27 -0
  203. data/samples/controls/icons/gauge.xpm +27 -0
  204. data/samples/controls/icons/list.xpm +27 -0
  205. data/samples/controls/icons/radio.xpm +27 -0
  206. data/samples/controls/icons/stattext.xpm +24 -0
  207. data/samples/controls/icons/text.xpm +27 -0
  208. data/samples/controls/mondrian.ico +0 -0
  209. data/samples/controls/mondrian.xpm +44 -0
  210. data/samples/controls/test2.bmp +0 -0
  211. data/samples/dialogs/dialogs.rb +797 -0
  212. data/samples/dialogs/tips.txt +18 -0
  213. data/samples/dragdrop/dragdrop.rb +177 -0
  214. data/samples/drawing/bitmap.rb +49 -0
  215. data/samples/drawing/bitmap_image.rb +92 -0
  216. data/samples/drawing/graphics_drawing.rb +235 -0
  217. data/samples/drawing/maths_images.rb +265 -0
  218. data/samples/drawing/rmagic_bitmap_image.rb +110 -0
  219. data/samples/drawing/ruby-logo.jpg +0 -0
  220. data/samples/etc/activation.rb +102 -0
  221. data/samples/etc/choice.rb +67 -0
  222. data/samples/etc/miniframe.rb +79 -0
  223. data/samples/etc/sash.rb +130 -0
  224. data/samples/etc/scrollwin.rb +110 -0
  225. data/samples/etc/system_settings.rb +252 -0
  226. data/samples/etc/threaded.rb +72 -0
  227. data/samples/etc/toolbar_sizer_additem.rb +55 -0
  228. data/samples/etc/wizard.rb +74 -0
  229. data/samples/event/event.rb +182 -0
  230. data/samples/event/update_ui_event.rb +70 -0
  231. data/samples/grid/grid.rb +198 -0
  232. data/samples/grid/gridtablebase.rb +148 -0
  233. data/samples/html/html.rb +262 -0
  234. data/samples/listbook/listbook.rb +174 -0
  235. data/samples/listbook/listbook.xrc +370 -0
  236. data/samples/mdi/mdi.rb +85 -0
  237. data/samples/media/mediactrl.rb +167 -0
  238. data/samples/minimal/minimal.rb +77 -0
  239. data/samples/minimal/mondrian.ico +0 -0
  240. data/samples/minimal/mondrian.png +0 -0
  241. data/samples/minimal/nothing.rb +16 -0
  242. data/samples/opengl/cube.rb +130 -0
  243. data/samples/opengl/cube_anim_lighting.rb +191 -0
  244. data/samples/printing/mondrian.ico +0 -0
  245. data/samples/printing/mondrian.xpm +44 -0
  246. data/samples/printing/printing.rb +487 -0
  247. data/samples/sockets/SocketPackets.rb +27 -0
  248. data/samples/sockets/res/message-new.png +0 -0
  249. data/samples/sockets/res/user.png +0 -0
  250. data/samples/sockets/wxClient.rb +395 -0
  251. data/samples/sockets/wxServer.rb +422 -0
  252. data/samples/sockets/wxSocketGUI.rb +97 -0
  253. data/samples/text/document-open.png +0 -0
  254. data/samples/text/document-save.png +0 -0
  255. data/samples/text/edit-copy.png +0 -0
  256. data/samples/text/edit-cut.png +0 -0
  257. data/samples/text/edit-paste.png +0 -0
  258. data/samples/text/edit-redo.png +0 -0
  259. data/samples/text/edit-undo.png +0 -0
  260. data/samples/text/format-text-bold.png +0 -0
  261. data/samples/text/format-text-italic.png +0 -0
  262. data/samples/text/format-text-underline.png +0 -0
  263. data/samples/text/mondrian.ico +0 -0
  264. data/samples/text/mondrian.xpm +44 -0
  265. data/samples/text/preferences-desktop-font.png +0 -0
  266. data/samples/text/rich_textctrl.rb +290 -0
  267. data/samples/text/scintilla.rb +169 -0
  268. data/samples/text/textctrl.rb +111 -0
  269. data/samples/text/unicode.rb +242 -0
  270. data/samples/text/utf8.txt +15 -0
  271. data/samples/treectrl/icon1.xpm +79 -0
  272. data/samples/treectrl/icon2.xpm +53 -0
  273. data/samples/treectrl/icon3.xpm +79 -0
  274. data/samples/treectrl/icon4.xpm +43 -0
  275. data/samples/treectrl/icon5.xpm +79 -0
  276. data/samples/treectrl/treectrl.rb +1166 -0
  277. data/samples/xrc/samples.xrc +46 -0
  278. data/samples/xrc/xrc_sample.rb +76 -0
  279. metadata +330 -0
@@ -0,0 +1,191 @@
1
+ #!/usr/bin/env ruby
2
+ # wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
3
+ # Freely reusable code: see SAMPLES-LICENSE.TXT for details
4
+
5
+ # OpenGL sample by Chauk-Mean Proum featuring an animated cube with lighting.
6
+ # OpenGL commands are structured following the Red Book :
7
+ # - init part (opengl_init)
8
+ # - resize part (opengl_resize)
9
+ # - render part (opengl_render)
10
+
11
+ begin
12
+ require 'rubygems'
13
+ rescue LoadError
14
+ end
15
+ require 'wx'
16
+ require 'gl'
17
+ require 'glu'
18
+
19
+ include Gl
20
+ include Glu
21
+
22
+ class CubeFrame < Wx::Frame
23
+ def initialize(title)
24
+ super(nil, :title => title)
25
+
26
+ sizer = Wx::VBoxSizer.new
27
+
28
+ attrib = [Wx::GL_RGBA, Wx::GL_DOUBLEBUFFER, Wx::GL_DEPTH_SIZE, 24]
29
+ # Use of keyword arguments for the GLCanvas initializer
30
+ @canvas = Wx::GLCanvas.new(self, :attrib_list => attrib, :size => [600, 600])
31
+ sizer.add_item @canvas, :proportion => 1, :flag => Wx::EXPAND
32
+
33
+ text = Wx::StaticText.new(self, :label => "Use Up/Down/Left/Right keys to change rotation direction")
34
+ sizer.add_item text
35
+
36
+ self.sizer = sizer
37
+ sizer.fit(self)
38
+
39
+ self.show
40
+ # A GL context can be set to a GL canvas only if the latter has been shown
41
+ opengl_init()
42
+ opengl_resize()
43
+
44
+ # set the focus on the GL canvas for key press
45
+ @canvas.set_focus
46
+ @canvas.evt_key_down {|evt| on_key_down(evt.get_key_code) }
47
+
48
+ @canvas.evt_paint { @canvas.paint { opengl_render } }
49
+ @canvas.evt_size do |e|
50
+ opengl_resize
51
+ e.skip()
52
+ end
53
+
54
+ # set up the animation
55
+ @rotate = [15.0, -30.0, 0.0]
56
+ @anim_step_x_axis = -1.0
57
+ @anim_step_y_axis = -2.0
58
+ anim_timer = Wx::Timer.new(self)
59
+ anim_timer.start(25) # start the timer with a period of 25 ms
60
+ evt_timer anim_timer, :animate
61
+
62
+ end
63
+
64
+ def animate
65
+ @rotate[0] += @anim_step_x_axis
66
+ @rotate[1] += @anim_step_y_axis
67
+ opengl_render()
68
+ end
69
+
70
+ def on_key_down(key)
71
+ case key
72
+ when Wx::K_UP
73
+ @anim_step_x_axis = -1.0
74
+ when Wx::K_DOWN
75
+ @anim_step_x_axis = 1.0
76
+ when Wx::K_LEFT
77
+ @anim_step_y_axis = -2.0
78
+ when Wx::K_RIGHT
79
+ @anim_step_y_axis = 2.0
80
+ end
81
+ opengl_render()
82
+ end
83
+
84
+
85
+ def opengl_init
86
+ # initialize the GL rendering
87
+ @canvas.set_current
88
+
89
+ mat_specular = [1.0, 1.0, 1.0, 1.0]
90
+ mat_shininess = [90.0]
91
+
92
+ light_ambient = [0.9, 0.9, 0.9, 1.0]
93
+ light_position = [-1.0, 4.0, 7.0, 0.0]
94
+
95
+ glLoadIdentity()
96
+
97
+ # glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular)
98
+ # glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess)
99
+
100
+ glLightfv(GL_LIGHT0, GL_DIFFUSE, light_ambient)
101
+ glLightfv(GL_LIGHT0, GL_POSITION, light_position)
102
+
103
+ glColorMaterial(GL_FRONT, GL_DIFFUSE)
104
+
105
+ glEnable(GL_LIGHTING)
106
+ glEnable(GL_LIGHT0)
107
+ glEnable(GL_COLOR_MATERIAL)
108
+
109
+ glDepthFunc(GL_LEQUAL)
110
+ glEnable(GL_DEPTH_TEST)
111
+ end
112
+
113
+ def opengl_resize
114
+ @canvas.set_current
115
+ sz = @canvas.size
116
+ w = sz.width
117
+ h = sz.height
118
+ glViewport(0, 0, w, h)
119
+ glMatrixMode(GL_PROJECTION)
120
+ glLoadIdentity()
121
+ gluPerspective(30.0, w.to_f/h.to_f, 1.0, 20.0)
122
+ glMatrixMode(GL_MODELVIEW)
123
+ end
124
+
125
+ def opengl_render
126
+ @canvas.set_current
127
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
128
+ glLoadIdentity()
129
+
130
+ gluLookAt(0.0, 3.0, 8.0, # position
131
+ 0.0, 0.0, 0.0, # target
132
+ 0.0, 1.0, 0.0) # up direction
133
+
134
+ glRotate(@rotate[0], 1.0, 0.0, 0.0)
135
+ glRotate(@rotate[1], 0.0, 1.0, 0.0)
136
+ glRotate(@rotate[2], 0.0, 0.0, 1.0)
137
+
138
+ glBegin(GL_QUADS)
139
+
140
+ #left
141
+ glNormal3d(-1.0, 0.0, 0.0) # normal vector is required for proper lighting
142
+ glColor3d(1.0, 1.0, 0.0) # yellow
143
+ glVertex3d(-1.0,-1.0,-1.0)
144
+ glVertex3d(-1.0, 1.0,-1.0)
145
+ glVertex3d(-1.0, 1.0, 1.0)
146
+ glVertex3d(-1.0,-1.0, 1.0)
147
+ #right
148
+ glNormal3d( 1.0, 0.0, 0.0)
149
+ glColor3d(0.0, 1.0, 0.0) # green
150
+ glVertex3d( 1.0,-1.0,-1.0)
151
+ glVertex3d( 1.0, 1.0,-1.0)
152
+ glVertex3d( 1.0, 1.0, 1.0)
153
+ glVertex3d( 1.0,-1.0, 1.0)
154
+ #up
155
+ glNormal3d( 0.0, 1.0, 0.0)
156
+ glColor3d(0.0, 0.0, 1.0) # blue
157
+ glVertex3d(-1.0, 1.0,-1.0)
158
+ glVertex3d( 1.0, 1.0,-1.0)
159
+ glVertex3d( 1.0, 1.0, 1.0)
160
+ glVertex3d(-1.0, 1.0, 1.0)
161
+ #down
162
+ glNormal3d( 0.0,-1.0, 0.0)
163
+ glColor3d(0.0, 1.0, 1.0) # cyan
164
+ glVertex3d(-1.0,-1.0,-1.0)
165
+ glVertex3d( 1.0,-1.0,-1.0)
166
+ glVertex3d( 1.0,-1.0, 1.0)
167
+ glVertex3d(-1.0,-1.0, 1.0)
168
+ #front
169
+ glNormal3d( 0.0, 0.0, 1.0)
170
+ glColor3d(1.0, 0.0, 0.0) # red
171
+ glVertex3d(-1.0,-1.0, 1.0)
172
+ glVertex3d(-1.0, 1.0, 1.0)
173
+ glVertex3d( 1.0, 1.0, 1.0)
174
+ glVertex3d( 1.0,-1.0, 1.0)
175
+ #back
176
+ glNormal3d( 0.0, 0.0,-1.0)
177
+ glColor3d(1.0, 0.0, 1.0) # magenta
178
+ glVertex3d(-1.0,-1.0,-1.0)
179
+ glVertex3d(-1.0, 1.0,-1.0)
180
+ glVertex3d( 1.0, 1.0,-1.0)
181
+ glVertex3d( 1.0,-1.0,-1.0)
182
+ glEnd()
183
+ glFlush()
184
+ @canvas.swap_buffers
185
+ end
186
+ end
187
+
188
+ Wx::App.run do
189
+ self.app_name = 'GLCanvas Cube'
190
+ frame = CubeFrame.new("OpenGL Canvas wxRuby : Animation and Lighting")
191
+ end
@@ -0,0 +1,44 @@
1
+ /* XPM */
2
+ static char *mondrian_xpm[] = {
3
+ /* columns rows colors chars-per-pixel */
4
+ "32 32 6 1",
5
+ " c Black",
6
+ ". c Blue",
7
+ "X c #00bf00",
8
+ "o c Red",
9
+ "O c Yellow",
10
+ "+ c Gray100",
11
+ /* pixels */
12
+ " ",
13
+ " oooooo +++++++++++++++++++++++ ",
14
+ " oooooo +++++++++++++++++++++++ ",
15
+ " oooooo +++++++++++++++++++++++ ",
16
+ " oooooo +++++++++++++++++++++++ ",
17
+ " oooooo +++++++++++++++++++++++ ",
18
+ " oooooo +++++++++++++++++++++++ ",
19
+ " oooooo +++++++++++++++++++++++ ",
20
+ " ",
21
+ " ++++++ ++++++++++++++++++ .... ",
22
+ " ++++++ ++++++++++++++++++ .... ",
23
+ " ++++++ ++++++++++++++++++ .... ",
24
+ " ++++++ ++++++++++++++++++ .... ",
25
+ " ++++++ ++++++++++++++++++ .... ",
26
+ " ++++++ ++++++++++++++++++ ",
27
+ " ++++++ ++++++++++++++++++ ++++ ",
28
+ " ++++++ ++++++++++++++++++ ++++ ",
29
+ " ++++++ ++++++++++++++++++ ++++ ",
30
+ " ++++++ ++++++++++++++++++ ++++ ",
31
+ " ++++++ ++++++++++++++++++ ++++ ",
32
+ " ++++++ ++++++++++++++++++ ++++ ",
33
+ " ++++++ ++++++++++++++++++ ++++ ",
34
+ " ++++++ ++++++++++++++++++ ++++ ",
35
+ " ++++++ ++++++++++++++++++ ++++ ",
36
+ " ++++++ ++++ ",
37
+ " ++++++ OOOOOOOOOOOO XXXXX ++++ ",
38
+ " ++++++ OOOOOOOOOOOO XXXXX ++++ ",
39
+ " ++++++ OOOOOOOOOOOO XXXXX ++++ ",
40
+ " ++++++ OOOOOOOOOOOO XXXXX ++++ ",
41
+ " ++++++ OOOOOOOOOOOO XXXXX ++++ ",
42
+ " ++++++ OOOOOOOOOOOO XXXXX ++++ ",
43
+ " "
44
+ };
@@ -0,0 +1,487 @@
1
+ #!/usr/bin/env ruby
2
+ # wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
3
+ # Freely reusable code: see SAMPLES-LICENSE.TXT for details
4
+ begin
5
+ require 'rubygems'
6
+ rescue LoadError
7
+ end
8
+ require 'wx'
9
+
10
+ WXPRINT_QUIT = Wx::ID_EXIT
11
+ WXPRINT_PRINT = Wx::ID_PRINT
12
+ WXPRINT_PAGE_SETUP = Wx::ID_PRINT_SETUP
13
+ WXPRINT_PREVIEW = Wx::ID_PREVIEW
14
+
15
+ WXPRINT_PRINT_PS = 105
16
+ WXPRINT_PAGE_SETUP_PS = 107
17
+ WXPRINT_PREVIEW_PS = 108
18
+
19
+ WXPRINT_ABOUT = Wx::ID_ABOUT
20
+
21
+ WXPRINT_ANGLEUP = 110
22
+ WXPRINT_ANGLEDOWN = 111
23
+
24
+ class MyFrame < Wx::Frame
25
+
26
+ attr_accessor :canvas
27
+
28
+ def initialize(parent,title,pos,size)
29
+ super(parent,-1,title,pos,size)
30
+ @canvas = nil
31
+ @bitmap = Wx::Bitmap.new
32
+ @angle = 30
33
+
34
+ # map events
35
+ evt_menu(WXPRINT_QUIT) {|e| on_exit(e)}
36
+ evt_menu(WXPRINT_PRINT) {|e| on_print(e)}
37
+ evt_menu(WXPRINT_PREVIEW) {|e| on_print_preview(e)}
38
+ evt_menu(WXPRINT_PAGE_SETUP) {|e| on_page_setup(e)}
39
+ evt_menu(WXPRINT_ABOUT) {|e| on_print_about(e)}
40
+ evt_menu(WXPRINT_ANGLEUP) {|e| on_angle_up(e)}
41
+ evt_menu(WXPRINT_ANGLEDOWN) {|e| on_angle_down(e)}
42
+ end
43
+
44
+ def draw(dc)
45
+ dc.set_background(Wx::WHITE_BRUSH)
46
+ dc.clear()
47
+ dc.set_font(Wx::get_app.test_font)
48
+
49
+ dc.set_background_mode(Wx::TRANSPARENT)
50
+
51
+ dc.set_brush(Wx::CYAN_BRUSH)
52
+ dc.set_pen(Wx::RED_PEN)
53
+
54
+ dc.draw_rounded_rectangle(0, 20, 200, 80, 20)
55
+
56
+ dc.draw_text( "Rectangle 200 by 80", 40, 40)
57
+
58
+ dc.set_pen( Wx::Pen.new(Wx::BLACK,0,Wx::DOT_DASH) )
59
+ dc.draw_ellipse(50, 140, 100, 50)
60
+ dc.set_pen(Wx::RED_PEN)
61
+
62
+ dc.draw_text( "Test message: this is in 10 point text", 10, 180)
63
+
64
+ test = "Hebrew שלום -- Japanese (日本語)"
65
+ dc.draw_text( test, 10, 200 )
66
+
67
+ points = []
68
+ points << Wx::Point.new(0,0)
69
+ points << Wx::Point.new(20,0)
70
+ points << Wx::Point.new(20,20)
71
+ points << Wx::Point.new(10,20)
72
+ points << Wx::Point.new(10,-20)
73
+
74
+ dc.draw_polygon( points, 20, 250, Wx::ODDEVEN_RULE )
75
+ dc.draw_polygon( points, 50, 250, Wx::WINDING_RULE )
76
+
77
+ dc.draw_elliptic_arc( 80, 250, 60, 30, 0.0, 270.0 )
78
+
79
+ points[0].x = 150
80
+ points[0].y = 250
81
+ points[1].x = 180
82
+ points[1].y = 250
83
+ points[2].x = 180
84
+ points[2].y = 220
85
+ points[3].x = 200
86
+ points[3].y = 220
87
+ points.pop
88
+ dc.draw_spline( points )
89
+
90
+ dc.draw_arc( 20,10, 10,10, 25,40 )
91
+
92
+ str = ""
93
+ i = 0
94
+ str = "---- Text at angle #{i} ----"
95
+ dc.draw_rotated_text( str, 100, 300, i )
96
+
97
+ i = @angle;
98
+ str = "---- Text at angle #{i} ----"
99
+ dc.draw_rotated_text( str, 100, 300, i )
100
+
101
+ dc.set_pen(Wx::BLACK_PEN)
102
+ dc.draw_line(0, 0, 200, 200)
103
+ dc.draw_line(200, 0, 0, 200)
104
+
105
+ # Load icon
106
+ if Wx::PLATFORM == "WXMSW"
107
+ icon_file = File.join(File.dirname(__FILE__), 'mondrian.ico')
108
+ my_icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_ICO)
109
+ else
110
+ icon_file = File.join(File.dirname(__FILE__), 'mondrian.xpm')
111
+ my_icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_XPM)
112
+ end
113
+
114
+ dc.draw_icon( my_icon, 100, 100)
115
+
116
+ if @bitmap.is_ok
117
+ dc.draw_bitmap( @bitmap, 10, 10 )
118
+ end
119
+ end
120
+
121
+ def on_angle_up(event)
122
+ @angle += 5
123
+ canvas.refresh
124
+ end
125
+
126
+ def on_angle_down(event)
127
+ @angle -= 5
128
+ canvas.refresh
129
+ end
130
+
131
+ def on_size(event)
132
+ super(event)
133
+ end
134
+
135
+ def on_print(event)
136
+ print_dialog_data = Wx::PrintDialogData.new(Wx::get_app.print_data)
137
+
138
+ printer = Wx::Printer.new(print_dialog_data)
139
+ printout = MyPrintout.new("My printout")
140
+ if (!printer.print(self, printout, true))
141
+ if (Wx::Printer.get_last_error == Wx::PRINTER_ERROR)
142
+ Wx::message_box("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", Wx::OK)
143
+ else
144
+ Wx::message_box("You canceled printing", "Printing", Wx::OK)
145
+ end
146
+ else
147
+ Wx::get_app.print_data = printer.get_print_dialog_data.get_print_data
148
+ end
149
+ end
150
+
151
+ def on_print_preview(event)
152
+ # Pass two printout objects: for preview, and possible printing.
153
+ print_dialog_data = Wx::PrintDialogData.new(Wx::get_app.print_data)
154
+ preview = Wx::PrintPreview.new(MyPrintout.new, MyPrintout.new, print_dialog_data)
155
+ if not preview.is_ok
156
+ #delete preview;
157
+ Wx::message_box("There was a problem previewing.\nPerhaps your current printer is not set correctly?", "Previewing", Wx::OK)
158
+ return
159
+ end
160
+
161
+ prev_frame = Wx::PreviewFrame.new(preview, self, "Demo Print Preview", Wx::Point.new(100, 100), Wx::Size.new(600, 650))
162
+ prev_frame.centre(Wx::BOTH)
163
+ prev_frame.init
164
+ prev_frame.show
165
+ end
166
+
167
+ def on_page_setup(event)
168
+ Wx::get_app.page_setup_data = Wx::PageSetupDialogData.new(Wx::get_app.print_data)
169
+ page_setup_dialog = Wx::PageSetupDialog.new(self, Wx::get_app.page_setup_data)
170
+ page_setup_dialog.show_modal
171
+
172
+ Wx::get_app.print_data = page_setup_dialog.get_page_setup_data.get_print_data
173
+ Wx::get_app.page_setup_data = Wx::PageSetupDialogData.new(Wx::get_app.print_data)
174
+ end
175
+
176
+ def on_exit(event)
177
+ close(true)
178
+ end
179
+
180
+ def on_print_about(event)
181
+ Wx::message_box("wxWidgets printing demo\nAuthor: Julian Smart\nAdapted to wxRuby by Sean Long",
182
+ "About wxRuby printing demo", Wx::OK|Wx::CENTRE)
183
+ end
184
+
185
+ end
186
+
187
+ class MyCanvas < Wx::ScrolledWindow
188
+ #attr_accessor :frame
189
+
190
+ def initialize(parent,pos,size,style = Wx::RETAINED)
191
+ super(parent,-1,pos,size,style)
192
+ @frame = parent
193
+ set_background_colour(Wx::WHITE)
194
+ evt_mouse_events() {|e| on_event(e)}
195
+ end
196
+
197
+ def on_draw(dc)
198
+ @frame.draw(dc)
199
+ end
200
+
201
+ def on_event(event)
202
+ end
203
+ end
204
+
205
+ class MyPrintout < Wx::Printout
206
+ def initialize(title = "My printout")
207
+ super(title)
208
+ end
209
+
210
+ def on_print_page(page)
211
+ dc = get_dc
212
+ if dc
213
+ if page == 1
214
+ draw_page_one(dc)
215
+ elsif (page == 2)
216
+ draw_page_two(dc)
217
+ end
218
+ dc.set_device_origin(0, 0)
219
+ dc.set_user_scale(1.0, 1.0)
220
+
221
+ buf = "PAGE #{page}"
222
+ dc.draw_text(buf, 10, 10)
223
+
224
+ return true
225
+ else
226
+ return false
227
+ end
228
+ end
229
+
230
+ def on_begin_document(start_page,end_page)
231
+ go_ahead = super(start_page, end_page)
232
+ if (!go_ahead)
233
+ return false
234
+ end
235
+ return true
236
+ end
237
+
238
+ def has_page(page)
239
+ return (page == 1 || page == 2)
240
+ end
241
+
242
+ def get_page_info
243
+ min_page = 1
244
+ max_page = 2
245
+ sel_page_from = 1
246
+ sel_page_to = 2
247
+ [min_page,max_page,sel_page_from,sel_page_to]
248
+ end
249
+
250
+ def draw_page_one(dc)
251
+ # You might use THIS code if you were scaling
252
+ # graphics of known size to fit on the page.
253
+
254
+ # We know the graphic is 200x200. If we didn't know this,
255
+ # we'd need to calculate it.
256
+ max_x = 200
257
+ max_y = 200
258
+
259
+ # Let's have at least 50 device units margin
260
+ margin_x = 50
261
+ margin_y = 50
262
+
263
+ # Add the margin to the graphic size
264
+ max_x += (2*margin_x)
265
+ max_y += (2*margin_y)
266
+
267
+ # Get the size of the DC in pixels
268
+ size = dc.get_size
269
+ w = size.get_width
270
+ h = size.get_height
271
+
272
+ # Calculate a suitable scaling factor
273
+ scale_x=(w/max_x)
274
+ scale_y=(h/max_y)
275
+
276
+ # Use x or y scaling factor, whichever fits on the DC
277
+ #actualScale = Wx::min(scaleX,scaleY)
278
+ if scale_x < scale_y
279
+ actual_scale = scale_x
280
+ else
281
+ actual_scale = scale_y
282
+ end
283
+
284
+ # Calculate the position on the DC for centring the graphic
285
+ pos_x = ((w - (200*actual_scale))/2.0)
286
+ pos_y = ((h - (200*actual_scale))/2.0)
287
+
288
+ # Set the scale and origin
289
+ dc.set_user_scale(actual_scale, actual_scale)
290
+ dc.set_device_origin( pos_x.to_i, pos_y.to_i )
291
+
292
+ Wx::get_app.frame.draw(dc)
293
+ end
294
+
295
+ def draw_page_two(dc)
296
+ # You might use THIS code to set the printer DC to ROUGHLY reflect
297
+ # the screen text size. This page also draws lines of actual length
298
+ # 5cm on the page.
299
+
300
+ # Get the logical pixels per inch of screen and printer
301
+ ppi_screen_x, ppi_screen_y = get_ppi_screen
302
+ ppi_printer_x, ppi_printer_y = get_ppi_printer
303
+
304
+ # This scales the DC so that the printout roughly represents the
305
+ # the screen scaling. The text point size _should_ be the right size
306
+ # but in fact is too small for some reason. This is a detail that will
307
+ # need to be addressed at some point but can be fudged for the
308
+ # moment.
309
+ scale = ( ppi_printer_x.to_f / ppi_screen_x.to_f )
310
+
311
+ # Now we have to check in case our real page size is reduced
312
+ # (e.g. because we're drawing to a print preview memory DC)
313
+ page_width, page_height = get_page_size_pixels
314
+ size = dc.get_size
315
+ w = size.get_width
316
+ h = size.get_height
317
+
318
+ # If printer pageWidth == current DC width, then this doesn't
319
+ # change. But w might be the preview bitmap width, so scale down.
320
+ overall_scale = scale * (w/page_width)
321
+ dc.set_user_scale(overall_scale, overall_scale)
322
+
323
+ # Calculate conversion factor for converting millimetres into
324
+ # logical units.
325
+ # There are approx. 25.4 mm to the inch. There are ppi
326
+ # device units to the inch. Therefore 1 mm corresponds to
327
+ # ppi/25.4 device units. We also divide by the
328
+ # screen-to-printer scaling factor, because we need to
329
+ # unscale to pass logical units to DrawLine.
330
+
331
+ # Draw 50 mm by 50 mm L shape
332
+ log_units_factor = (ppi_printer_x/(scale*25.4))
333
+ log_units = (50*log_units_factor)
334
+ dc.set_pen(Wx::BLACK_PEN)
335
+ dc.draw_line(50, 250, (50.0 + log_units).to_i, 250)
336
+ dc.draw_line(50, 250, 50, (250.0 + log_units).to_i)
337
+
338
+ dc.set_background_mode(Wx::TRANSPARENT)
339
+ dc.set_brush(Wx::TRANSPARENT_BRUSH)
340
+
341
+ # GetTextExtent demo:
342
+ words = ["This ", "is ", "GetTextExtent ", "testing ", "string. ", "Enjoy ", "it!"]
343
+ w, h = 0,0
344
+ x = 200
345
+ y= 250
346
+ fnt = Wx::Font.new(15, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
347
+
348
+ dc.set_font(fnt)
349
+
350
+ words.each do |word|
351
+ w,h = dc.get_text_extent(word)
352
+ dc.draw_rectangle(x, y, w.to_i, h.to_i)
353
+ w,h = dc.get_text_extent(word)
354
+ dc.draw_text(word, x, y)
355
+ x += w
356
+ end
357
+
358
+ dc.set_font(Wx::get_app.test_font)
359
+
360
+ dc.draw_text("Some test text", 200, 300 )
361
+
362
+ left_margin = 20
363
+ right_margin = 20
364
+ top_margin = 20
365
+ bottom_margin = 20
366
+
367
+ page_width_mm, page_height_mm = get_page_size_mm
368
+
369
+ left_margin_logical = (log_units_factor*left_margin).to_i
370
+ top_margin_logical = (log_units_factor*top_margin).to_i
371
+ bottom_margin_logical = (log_units_factor*(page_height_mm - bottom_margin)).to_i
372
+ right_margin_logical = (log_units_factor*(page_width_mm - right_margin)).to_i
373
+
374
+ dc.set_pen(Wx::RED_PEN)
375
+ dc.draw_line( left_margin_logical, top_margin_logical,
376
+ right_margin_logical, top_margin_logical)
377
+ dc.draw_line( left_margin_logical, bottom_margin_logical,
378
+ right_margin_logical, bottom_margin_logical)
379
+
380
+ write_page_header(self, dc, "A header", log_units_factor)
381
+ end
382
+
383
+ # Writes a header on a page. Margin units are in millimetres.
384
+ def write_page_header(printout, dc, text, mm_to_logical)
385
+ page_width_mm, page_height_mm = printout.get_page_size_mm
386
+
387
+ left_margin = 10
388
+ top_margin = 10
389
+ right_margin = 10
390
+
391
+ left_margin_logical = (mm_to_logical*left_margin).to_i
392
+ top_margin_logical = (mm_to_logical*top_margin).to_i
393
+ right_margin_logical = (mm_to_logical*(page_width_mm - right_margin)).to_i
394
+
395
+ x_extent, y_extent= dc.get_text_extent(text)
396
+ x_pos = (((((page_width_mm - left_margin - right_margin)/2.0)+left_margin)*mm_to_logical) - (x_extent/2.0))
397
+ dc.draw_text(text, x_pos.to_i, top_margin_logical)
398
+
399
+ dc.set_pen(Wx::BLACK_PEN)
400
+ dc.draw_line( left_margin_logical, (top_margin_logical + y_extent).to_i,
401
+ right_margin_logical, (top_margin_logical + y_extent).to_i )
402
+
403
+ return true
404
+ end
405
+ end
406
+
407
+ class MyApp < Wx::App
408
+ attr_accessor :frame,:test_font,:print_data,:page_setup_data
409
+
410
+ def on_init
411
+ @test_font = Wx::Font.new(10, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
412
+
413
+ # Create the main frame window
414
+ @frame = MyFrame.new(nil, "wxRuby Printing Demo", Wx::Point.new(0, 0), Wx::Size.new(400, 400))
415
+
416
+ # Give it a status line
417
+ @frame.create_status_bar(2)
418
+
419
+
420
+ # Load icon and bitmap
421
+ if Wx::PLATFORM == "WXMSW"
422
+ icon_file = File.join(File.dirname(__FILE__), 'mondrian.ico')
423
+ @frame.set_icon( Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_ICO) )
424
+ else
425
+ icon_file = File.join(File.dirname(__FILE__), 'mondrian.xpm')
426
+ @frame.set_icon( Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_XPM) )
427
+ end
428
+
429
+ # Make a menubar
430
+ file_menu = Wx::Menu.new
431
+
432
+ file_menu.append(WXPRINT_PRINT, "&Print...","Print")
433
+ file_menu.append(WXPRINT_PAGE_SETUP, "Page Set&up...","Page setup")
434
+ file_menu.append(WXPRINT_PREVIEW, "Print Pre&view","Preview")
435
+
436
+ =begin
437
+ # Accelerators
438
+ wxAcceleratorEntry entries[1];
439
+ entries[0].Set(wxACCEL_CTRL, (int) 'V', WXPRINT_PREVIEW);
440
+ wxAcceleratorTable accel(1, entries);
441
+ frame->SetAcceleratorTable(accel);
442
+ =end
443
+
444
+ file_menu.append_separator()
445
+ file_menu.append(WXPRINT_ANGLEUP, "Angle up\tAlt-U","Raise rotated text angle")
446
+ file_menu.append(WXPRINT_ANGLEDOWN, "Angle down\tAlt-D","Lower rotated text angle")
447
+ file_menu.append_separator()
448
+ file_menu.append(WXPRINT_QUIT, "E&xit","Exit program")
449
+
450
+ help_menu = Wx::Menu.new
451
+ help_menu.append(WXPRINT_ABOUT, "&About","About this demo")
452
+
453
+ menu_bar = Wx::MenuBar.new
454
+
455
+ menu_bar.append(file_menu, "&File")
456
+ menu_bar.append(help_menu, "&Help")
457
+
458
+ # Associate the menu bar with the frame
459
+ @frame.set_menu_bar(menu_bar)
460
+
461
+ canvas = MyCanvas.new(@frame, Wx::Point.new(0, 0), Wx::Size.new(100, 100), Wx::RETAINED|Wx::HSCROLL|Wx::VSCROLL)
462
+
463
+ # Give it scrollbars: the virtual canvas is 20 * 50 = 1000 pixels in each direction
464
+ canvas.set_scrollbars(20, 20, 50, 50)
465
+
466
+ @frame.canvas = canvas
467
+
468
+ @frame.centre(Wx::BOTH)
469
+ @frame.show()
470
+
471
+ @frame.set_status_text("Printing demo")
472
+
473
+ set_top_window(@frame)
474
+
475
+ @print_data = Wx::PrintData.new
476
+ @page_setup_data = Wx::PageSetupDialogData.new
477
+
478
+ return true
479
+ end
480
+
481
+ def on_exit
482
+ return true
483
+ end
484
+ end
485
+
486
+
487
+ MyApp.new.main_loop()