libui_paradise 0.2.49 → 0.4.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +405 -259
  3. data/bin/libui_message +7 -0
  4. data/doc/README.gen +356 -131
  5. data/doc/todo/todo.md +14 -5
  6. data/lib/libui_paradise/autoinclude.rb +2 -1
  7. data/lib/libui_paradise/base/base.rb +51 -62
  8. data/lib/libui_paradise/base_module/base_module.rb +1514 -0
  9. data/lib/libui_paradise/colours/colours.rb +14 -2
  10. data/lib/libui_paradise/domain_specific_language/README.md +6 -0
  11. data/lib/libui_paradise/examples/complex/002_tabs_example.rb +1 -2
  12. data/lib/libui_paradise/examples/complex/003_open_file_button_example.rb +3 -5
  13. data/lib/libui_paradise/examples/complex/006_coloured_boxes_example.rb +2 -2
  14. data/lib/libui_paradise/examples/complex/007_slider_example.rb +10 -4
  15. data/lib/libui_paradise/examples/complex/008_radio_button_example.rb +2 -2
  16. data/lib/libui_paradise/examples/complex/009_separator_example.rb +2 -2
  17. data/lib/libui_paradise/examples/complex/010_table_example.rb +139 -49
  18. data/lib/libui_paradise/examples/complex/011_two_buttons_showing_how_to_enable_and_disable_them.rb +2 -1
  19. data/lib/libui_paradise/examples/complex/012_password_entry_example.rb +1 -1
  20. data/lib/libui_paradise/examples/complex/013_form_example.rb +1 -1
  21. data/lib/libui_paradise/examples/complex/014_text_example.rb +1 -1
  22. data/lib/libui_paradise/examples/complex/015_text_view_example.rb +4 -4
  23. data/lib/libui_paradise/examples/complex/016_grid_example.rb +20 -11
  24. data/lib/libui_paradise/examples/complex/017_unicode_text_example.rb +2 -2
  25. data/lib/libui_paradise/examples/complex/018_spinbutton_example.rb +1 -1
  26. data/lib/libui_paradise/examples/complex/019_combo_box_example.rb +1 -1
  27. data/lib/libui_paradise/examples/complex/020_checkbox_example.rb +5 -5
  28. data/lib/libui_paradise/examples/complex/021_font_example.rb +4 -3
  29. data/lib/libui_paradise/examples/complex/022_simple_notepad_example.rb +3 -3
  30. data/lib/libui_paradise/examples/complex/023_msg_box_error.rb +5 -5
  31. data/lib/libui_paradise/examples/complex/024_parse_config_file_example.rb +2 -2
  32. data/lib/libui_paradise/examples/complex/025_colour_button.rb +1 -1
  33. data/lib/libui_paradise/examples/complex/026_basic_table_image.rb +5 -8
  34. data/lib/libui_paradise/examples/complex/027_basic_button_example.rb +3 -3
  35. data/lib/libui_paradise/examples/complex/028_try_for_automatic_button_press_event_after_a_delay.rb +4 -5
  36. data/lib/libui_paradise/examples/complex/029_progressbar_example.rb +4 -5
  37. data/lib/libui_paradise/examples/complex/030_entry_responds_to_comment_as_synonymous_to_the_enter_key_pressed_example.rb +5 -6
  38. data/lib/libui_paradise/examples/complex/031_notification_functionality_example.rb +3 -2
  39. data/lib/libui_paradise/examples/complex/032_simple_window_example.rb +2 -1
  40. data/lib/libui_paradise/examples/complex/033_daemonize_and_exit_after_delay_example.rb +3 -2
  41. data/lib/libui_paradise/examples/complex/034_bold_text_example.rb +115 -0
  42. data/lib/libui_paradise/examples/complex/035_parse_into_table_example.rb +109 -0
  43. data/lib/libui_paradise/examples/simple/001_open_file_example.rb +1 -1
  44. data/lib/libui_paradise/examples/simple/002_histogram_example.rb +6 -6
  45. data/lib/libui_paradise/examples/simple/003_fancy_text_example.rb +80 -43
  46. data/lib/libui_paradise/examples/simple/005_text_drawing_example.rb +11 -11
  47. data/lib/libui_paradise/examples/simple/007_control_gallery.rb +21 -14
  48. data/lib/libui_paradise/examples/simple/009_spectrum.rb +7 -1
  49. data/lib/libui_paradise/examples/simple/010_font_button.rb +31 -0
  50. data/lib/libui_paradise/examples/simple/011_simple_notepad.rb +24 -0
  51. data/lib/libui_paradise/examples/simple/012_table_example.rb +71 -0
  52. data/lib/libui_paradise/examples/simple/013_scrolling_pane_example.rb +28 -0
  53. data/lib/libui_paradise/examples/simple/014_simple_entry_example.rb +30 -0
  54. data/lib/libui_paradise/examples/simple/015_slider_example.rb +32 -0
  55. data/lib/libui_paradise/fiddle/{pointer.rb → fiddle.rb} +768 -615
  56. data/lib/libui_paradise/generic_window/generic_window.rb +1 -1
  57. data/lib/libui_paradise/images/README.md +5 -2
  58. data/lib/libui_paradise/libui_classes/button.rb +31 -0
  59. data/lib/libui_paradise/libui_classes/entry.rb +35 -0
  60. data/lib/libui_paradise/libui_classes/grid.rb +14 -23
  61. data/lib/libui_paradise/libui_classes/hbox.rb +39 -0
  62. data/lib/libui_paradise/libui_classes/libui_classes.rb +9 -1595
  63. data/lib/libui_paradise/libui_classes/msg_box.rb +121 -0
  64. data/lib/libui_paradise/libui_classes/msg_box_error.rb +41 -0
  65. data/lib/libui_paradise/libui_classes/slider.rb +28 -0
  66. data/lib/libui_paradise/libui_classes/spinbox.rb +48 -0
  67. data/lib/libui_paradise/libui_classes/vbox.rb +38 -0
  68. data/lib/libui_paradise/project/project.rb +6 -1
  69. data/lib/libui_paradise/prototype/prototype.rb +8 -10
  70. data/lib/libui_paradise/requires/require_the_libui_classes.rb +2 -2
  71. data/lib/libui_paradise/requires/require_the_libui_paradise_project.rb +5 -3
  72. data/lib/libui_paradise/toplevel_methods/add_to_the_registered_widgets.rb +70 -0
  73. data/lib/libui_paradise/toplevel_methods/hash_fiddle_pointer_widgets.rb +37 -0
  74. data/lib/libui_paradise/toplevel_methods/toplevel_counters.rb +83 -0
  75. data/lib/libui_paradise/toplevel_methods/toplevel_methods.rb +792 -0
  76. data/lib/libui_paradise/version/version.rb +2 -2
  77. data/lib/libui_paradise.rb +0 -0
  78. data/libui_paradise.gemspec +5 -4
  79. data/test/testing_generic_window.rb +2 -0
  80. metadata +35 -30
  81. data/doc/SNIPPETS.md +0 -94
  82. data/lib/libui_paradise/extensions/counters.rb +0 -58
  83. data/lib/libui_paradise/extensions/extensions.rb +0 -29
  84. data/lib/libui_paradise/extensions/hash_fiddle_pointer_widgets.rb +0 -150
  85. data/lib/libui_paradise/extensions/misc.rb +0 -754
  86. data/lib/libui_paradise/libui_classes/box.rb +0 -156
  87. data/lib/libui_paradise/toplevel_methods/misc.rb +0 -13
@@ -6,14 +6,14 @@
6
6
  # =========================================================================== #
7
7
  require 'libui_paradise/autoinclude'
8
8
 
9
- main_window = main_window('hello world', 300, 200, 0)
9
+ main_window = create_window('hello world', 300, 200, 0)
10
10
 
11
11
  button = button('Button')
12
12
  button.on_clicked {|widget| # is a <Fiddle::Pointer:0x00005590774f1ca0 ptr=0x0000559077484c90 size=0 free=0x0000000000000000>
13
13
  e 'The main button was clicked.'
14
- ui_msg_box(main_window, 'Information', 'You clicked the button')
14
+ ui_msg_box(main_window, 'Information', 'The main button has been clicked.')
15
15
  0
16
16
  }
17
17
 
18
- main_window.child = button
18
+ main_window << button
19
19
  main_window.intelligent_exit
@@ -2,7 +2,7 @@
2
2
  # Encoding: UTF-8
3
3
  # frozen_string_literal: true
4
4
  # =========================================================================== #
5
- # require '020_checkbox_example'
5
+ # require '028_try_for_automatic_button_press_event_after_a_delay.rb'
6
6
  # =========================================================================== #
7
7
  require 'libui_paradise/autoinclude'
8
8
 
@@ -17,10 +17,9 @@ should_quit_callback = proc {
17
17
  0
18
18
  }
19
19
 
20
- MAIN_WINDOW = LibUI.window('Try for automatic button press event after a delay', 600, HEIGHT, 1)
21
- vbox = LibUI.vbox
22
- LibUI.box_set_padded(vbox, 1)
23
- button1 = LibUI.new_button('Testing')
20
+ MAIN_WINDOW = create_window('Try for automatic button press event after a delay', :default, HEIGHT, 1)
21
+ vbox = create_padded_vbox
22
+ button1 = create_button('Testing')
24
23
 
25
24
  LibUI.button_on_clicked(button1) do
26
25
  the_button_was_clicked
@@ -12,10 +12,8 @@ module LibUI
12
12
 
13
13
  class ProgressbarExample # === LibuiParadise::GUI::LibUI::ProgressbarExample
14
14
 
15
- alias e puts
16
-
17
15
  require 'libui_paradise'
18
- include LibuiParadise::Extensions
16
+ include LibuiParadise::BaseModule
19
17
 
20
18
  # ========================================================================= #
21
19
  # === TITLE
@@ -46,6 +44,7 @@ class ProgressbarExample # === LibuiParadise::GUI::LibUI::ProgressbarExample
46
44
  # === reset (reset tag)
47
45
  # ========================================================================= #
48
46
  def reset
47
+ reset_the_internal_hash
49
48
  title_width_height(TITLE, WIDTH, HEIGHT)
50
49
  end
51
50
 
@@ -56,7 +55,7 @@ class ProgressbarExample # === LibuiParadise::GUI::LibUI::ProgressbarExample
56
55
  # ======================================================================= #
57
56
  # === @window
58
57
  # ======================================================================= #
59
- @window = ui_padded_main_window(title?, width?, height?, 0)
58
+ @window = create_padded_main_window(title?, width?, height?, 0)
60
59
  end
61
60
 
62
61
  # ========================================================================= #
@@ -105,7 +104,7 @@ class ProgressbarExample # === LibuiParadise::GUI::LibUI::ProgressbarExample
105
104
  outer_vbox.minimal(@progress_bar)
106
105
  outer_vbox.minimal(quit_button)
107
106
  run_the_outer_thread
108
- @window.add(outer_vbox)
107
+ @window << outer_vbox
109
108
  @window.intelligent_exit
110
109
  end
111
110
 
@@ -12,10 +12,8 @@ module LibUI
12
12
 
13
13
  class EntryRespondsToCommentAsSynonymousToTheEnterKeyPressedExample # === LibuiParadise::GUI::LibUI::EntryRespondsToCommentAsSynonymousToTheEnterKeyPressedExample
14
14
 
15
- alias e puts
16
-
17
15
  require 'libui_paradise'
18
- include LibuiParadise::Extensions
16
+ include LibuiParadise::BaseModule
19
17
 
20
18
  # ========================================================================= #
21
19
  # === TITLE
@@ -46,6 +44,7 @@ class EntryRespondsToCommentAsSynonymousToTheEnterKeyPressedExample # === LibuiP
46
44
  # === reset (reset tag)
47
45
  # ========================================================================= #
48
46
  def reset
47
+ reset_the_internal_hash
49
48
  title_width_height(TITLE, WIDTH, HEIGHT)
50
49
  end
51
50
 
@@ -56,7 +55,7 @@ class EntryRespondsToCommentAsSynonymousToTheEnterKeyPressedExample # === LibuiP
56
55
  # ======================================================================= #
57
56
  # === @window
58
57
  # ======================================================================= #
59
- @window = ui_padded_main_window(title?, width?, height?, 0)
58
+ @window = create_padded_main_window(title?, width?, height?, 0)
60
59
  end
61
60
 
62
61
  # ========================================================================= #
@@ -104,7 +103,7 @@ class EntryRespondsToCommentAsSynonymousToTheEnterKeyPressedExample # === LibuiP
104
103
  }
105
104
  }
106
105
  outer_vbox.minimal(grid)
107
- @window.add(outer_vbox)
106
+ @window << outer_vbox
108
107
  @window.intelligent_exit
109
108
  end
110
109
 
@@ -128,7 +127,7 @@ class EntryRespondsToCommentAsSynonymousToTheEnterKeyPressedExample # === LibuiP
128
127
  &block
129
128
  )
130
129
  _ = entry.text?
131
- if _[-1,1] == '#'
130
+ if _.end_with?('#')
132
131
  yield if block_given?
133
132
  end
134
133
  end
@@ -15,7 +15,7 @@ class NotificationFunctionalityExample # === LibuiParadise::GUI::LibUI::Notifica
15
15
  alias e puts
16
16
 
17
17
  require 'libui_paradise'
18
- include LibuiParadise::Extensions
18
+ include LibuiParadise::BaseModule
19
19
 
20
20
  # ========================================================================= #
21
21
  # === TITLE
@@ -46,6 +46,7 @@ class NotificationFunctionalityExample # === LibuiParadise::GUI::LibUI::Notifica
46
46
  # === reset (reset tag)
47
47
  # ========================================================================= #
48
48
  def reset
49
+ reset_the_internal_hash
49
50
  title_width_height(TITLE, WIDTH, HEIGHT)
50
51
  end
51
52
 
@@ -56,7 +57,7 @@ class NotificationFunctionalityExample # === LibuiParadise::GUI::LibUI::Notifica
56
57
  # ======================================================================= #
57
58
  # === @window
58
59
  # ======================================================================= #
59
- @window = ui_padded_main_window(title?, width?, height?, 0)
60
+ @window = create_padded_main_window(title?, width?, height?, 0)
60
61
  end
61
62
 
62
63
  # ========================================================================= #
@@ -39,6 +39,7 @@ class NotificationFunctionalityExample < LibuiParadise::Base # === LibuiParadise
39
39
  # === reset (reset tag)
40
40
  # ========================================================================= #
41
41
  def reset
42
+ reset_the_internal_hash
42
43
  default_title_width_height(TITLE, WIDTH, HEIGHT)
43
44
  end
44
45
 
@@ -49,7 +50,7 @@ class NotificationFunctionalityExample < LibuiParadise::Base # === LibuiParadise
49
50
  # ======================================================================= #
50
51
  # === @window
51
52
  # ======================================================================= #
52
- @window = ui_padded_main_window(title?, width?, height?, 0)
53
+ @window = create_padded_main_window(title?, width?, height?, 0)
53
54
  end
54
55
 
55
56
  # ========================================================================= #
@@ -53,6 +53,7 @@ class DaemonizeAndExitAfterDelayExample < LibuiParadise::Base # === LibuiParadis
53
53
  # === reset (reset tag)
54
54
  # ========================================================================= #
55
55
  def reset
56
+ reset_the_internal_hash
56
57
  default_title_width_height(TITLE, WIDTH, HEIGHT)
57
58
  end
58
59
 
@@ -63,7 +64,7 @@ class DaemonizeAndExitAfterDelayExample < LibuiParadise::Base # === LibuiParadis
63
64
  # ======================================================================= #
64
65
  # === @window
65
66
  # ======================================================================= #
66
- @window = ui_padded_main_window(title?, width?, height?, 0)
67
+ @window = create_padded_main_window(title?, width?, height?, 0)
67
68
  end
68
69
 
69
70
  # ========================================================================= #
@@ -71,7 +72,7 @@ class DaemonizeAndExitAfterDelayExample < LibuiParadise::Base # === LibuiParadis
71
72
  # ========================================================================= #
72
73
  def run
73
74
  super()
74
- Thread.abort_on_exception = true
75
+ abort_on_exception
75
76
  run_in_the_background
76
77
  Thread.new {
77
78
  add_these_widgets_to_the_main_window(
@@ -0,0 +1,115 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require '034_bold_text_example.rb'
6
+ # =========================================================================== #
7
+ require 'libui_paradise/autoinclude'
8
+
9
+ # =========================================================================== #
10
+ # === FONT_FAMILY_TO_USE
11
+ # =========================================================================== #
12
+ FONT_FAMILY_TO_USE = 'Georgia'
13
+
14
+ window = margined_window(:filename, :default, 200, 0)
15
+
16
+ outer_vbox = padded_vbox
17
+
18
+ handler = LibUI::FFI::AreaHandler.malloc
19
+ handler.to_ptr.free = Fiddle::RUBY_FREE
20
+ area = LibUI.new_area(handler)
21
+
22
+ # Michael Ende (1929-1995)
23
+ # The Neverending Story is a fantasy novel by German writer Michael Ende,
24
+ # The English version, translated by Ralph Manheim, was published in 1983.
25
+
26
+ TITLE = 'Michael Ende'
27
+
28
+ str1 = ' With thelignancy. '
29
+ str2 = ' A cry of fear escaped Bastian. '
30
+ str3 = ' A cry of te '
31
+ str4 = ' Could shele'
32
+ str5 = ' And thens. '
33
+
34
+ str = ''
35
+ attr_str = LibUI.new_attributed_string(str)
36
+
37
+ # =========================================================================== #
38
+ # === attr_str.append
39
+ #
40
+ # The first argument is the text that should be appended.
41
+ # =========================================================================== #
42
+ def attr_str.append(this_text, color)
43
+ c = case color
44
+ # :red
45
+ when :red
46
+ [0.0, 0.5, 0.0, 0.7]
47
+ # :green
48
+ when :green
49
+ [0.5, 0.0, 0.25, 0.7]
50
+ end
51
+ color_attribute = LibUI.new_color_attribute(*c)
52
+ start_position = LibuiParadise.string_length(self) # self is a Fiddle::Pointer.
53
+ # ========================================================================= #
54
+ # 1) append the unattributed string
55
+ # ========================================================================= #
56
+ LibUI.attributed_string_append_unattributed(self, this_text)
57
+ # ========================================================================= #
58
+ # 2) style the attributed string next
59
+ # ========================================================================= #
60
+ LibUI.attributed_string_set_attribute(self, color_attribute, start_position, start_position + this_text.size)
61
+ # ========================================================================= #
62
+ # 3) Add two newlines
63
+ # ========================================================================= #
64
+ LibUI.attributed_string_append_unattributed(self, "\n\n")
65
+ end
66
+
67
+ attr_str.append(str1, :green)
68
+ attr_str.append(str2, :red)
69
+ attr_str.append(str3, :green)
70
+ attr_str.append(str4, :red)
71
+ attr_str.append(str5, :green)
72
+
73
+ handler_draw_event = Fiddle::Closure::BlockCaller.new(0, [1, 1, 1]) do |_, _, adp|
74
+ area_draw_params = LibUI::FFI::AreaDrawParams.new(adp)
75
+ default_font = LibUI::FFI::FontDescriptor.malloc
76
+ default_font.to_ptr.free = Fiddle::RUBY_FREE
77
+ default_font.Family = FONT_FAMILY_TO_USE
78
+ default_font.Size = 13
79
+ default_font.Weight = 500
80
+ default_font.Italic = 0
81
+ default_font.Stretch = 4
82
+ params = LibUI::FFI::DrawTextLayoutParams.malloc
83
+ params.to_ptr.free = Fiddle::RUBY_FREE
84
+
85
+ # LibUI.font_button_font(font_button, default_font)
86
+ params.String = attr_str
87
+ params.DefaultFont = default_font
88
+ params.Width = area_draw_params.AreaWidth
89
+ params.Align = 0
90
+ text_layout = LibUI.draw_new_text_layout(params)
91
+ LibUI.draw_text(area_draw_params.Context, text_layout, 0, 0)
92
+ LibUI.draw_free_text_layout(text_layout)
93
+ end
94
+
95
+ handler.Draw = handler_draw_event
96
+
97
+ # Assigning to local variables
98
+ # This is intended to protect Fiddle::Closure from garbage collection.
99
+ do_nothing = Fiddle::Closure::BlockCaller.new(0, [0]) {}
100
+ key_event = Fiddle::Closure::BlockCaller.new(1, [0]) { 0 }
101
+ handler.MouseEvent = do_nothing
102
+ handler.MouseCrossed = do_nothing
103
+ handler.DragBroken = do_nothing
104
+ handler.KeyEvent = key_event
105
+
106
+ box = outer_vbox
107
+ box << area
108
+
109
+ window = padded_window(TITLE, :default, 400, 1)
110
+ window << box
111
+ window.intelligent_exit
112
+
113
+ LibUI.control_show(window)
114
+ LibUI.main
115
+ LibUI.uninit
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require '035_parse_into_table_example.rb'
6
+ # =========================================================================== #
7
+ require 'libui_paradise/autoinclude'
8
+
9
+ module LibuiParadise
10
+
11
+ module GUI
12
+
13
+ module LibUI
14
+
15
+ class ParseIntoTableExample # === LibuiParadise::GUI::LibUI::ParseIntoTableExample
16
+
17
+ require 'libui_paradise'
18
+ include LibuiParadise::BaseModule
19
+
20
+ # ========================================================================= #
21
+ # === TITLE
22
+ # ========================================================================= #
23
+ TITLE = 'Parse into table example'
24
+
25
+ # ========================================================================= #
26
+ # === WIDTH
27
+ # ========================================================================= #
28
+ WIDTH = 1200
29
+
30
+ # ========================================================================= #
31
+ # === HEIGHT
32
+ # ========================================================================= #
33
+ HEIGHT = 120
34
+
35
+ # ========================================================================= #
36
+ # === initialize
37
+ # ========================================================================= #
38
+ def initialize(
39
+ run_already = true
40
+ )
41
+ reset
42
+ run if run_already
43
+ end
44
+
45
+ # ========================================================================= #
46
+ # === reset (reset tag)
47
+ # ========================================================================= #
48
+ def reset
49
+ reset_the_internal_hash
50
+ title_width_height(TITLE, WIDTH, HEIGHT)
51
+ end
52
+
53
+ # ========================================================================= #
54
+ # === create_skeleton (create tag, skeleton tag)
55
+ # ========================================================================= #
56
+ def create_skeleton
57
+ # ======================================================================= #
58
+ # === @window
59
+ # ======================================================================= #
60
+ @window = create_padded_main_window(title?, width?, height?, 0)
61
+ end
62
+
63
+ # ========================================================================= #
64
+ # === run
65
+ # ========================================================================= #
66
+ def run
67
+ create_skeleton_then_connect_skeleton
68
+ outer_vbox = padded_vbox
69
+ # ======================================================================= #
70
+ # First add the two buttons on top:
71
+ # ======================================================================= #
72
+ outer_vbox.add_hsep
73
+ grid = parse_into_table('/Depot/j/animals.yml')
74
+
75
+ outer_vbox.minimal(grid)
76
+ @window << outer_vbox
77
+ @window.intelligent_exit
78
+ end
79
+
80
+ # ========================================================================= #
81
+ # === run_this_method_on_enter_key_event
82
+ # ========================================================================= #
83
+ def run_this_method_on_enter_key_event(
84
+ entry = @entry
85
+ )
86
+ entry.set_text(
87
+ entry.text?[0 .. -2].to_s
88
+ )
89
+ end
90
+
91
+ # ========================================================================= #
92
+ # === evaluate_the_current_input
93
+ # ========================================================================= #
94
+ def evaluate_the_current_input(
95
+ entry = @entry,
96
+ pointer = nil,
97
+ &block
98
+ )
99
+ _ = entry.text?
100
+ if _.end_with?('#')
101
+ yield if block_given?
102
+ end
103
+ end
104
+
105
+ end; end; end; end
106
+
107
+ if __FILE__ == $PROGRAM_NAME
108
+ LibuiParadise::GUI::LibUI::ParseIntoTableExample.new
109
+ end
@@ -17,7 +17,7 @@ button = LibUI.new_button('Open File')
17
17
  LibUI.button_on_clicked(button) {
18
18
  result = ::LibUI.open_file(main_window).to_s
19
19
  if File.exist?(result)
20
- e 'The file exists. \o/'
20
+ e "The file exists, at `#{result}`. \o/"
21
21
  end
22
22
  }
23
23
 
@@ -64,9 +64,9 @@ def construct_graph(datapoints, width, height, should_extend)
64
64
  locations = point_locations(datapoints, width, height)
65
65
  path = LibUI.draw_new_path(0) # winding
66
66
  first_location = locations[0] # x and y
67
- UI.draw_path_new_figure(path, first_location[0], first_location[1])
67
+ LibUI.draw_path_new_figure(path, first_location[0], first_location[1])
68
68
  locations.each { |loc|
69
- UI.draw_path_line_to(path, loc[0], loc[1])
69
+ LibUI.draw_path_line_to(path, loc[0], loc[1])
70
70
  }
71
71
 
72
72
  if should_extend
@@ -85,8 +85,8 @@ handler_draw_event = Fiddle::Closure::BlockCaller.new(
85
85
  ) do |_area_handler, _area, area_draw_params|
86
86
  area_draw_params = UI::FFI::AreaDrawParams.new(area_draw_params)
87
87
  path = UI.draw_new_path(0) # winding
88
- UI.draw_path_add_rectangle(path, 0, 0, area_draw_params.AreaWidth, area_draw_params.AreaHeight)
89
- UI.draw_path_end(path)
88
+ LibUI.draw_path_add_rectangle(path, 0, 0, area_draw_params.AreaWidth, area_draw_params.AreaHeight)
89
+ LibUI.draw_path_end(path)
90
90
  set_solid_brush(brush, 0xFFFFFF, 1.0) # white
91
91
  UI.draw_fill(area_draw_params.Context, path, brush.to_ptr)
92
92
  UI.draw_free_path(path)
@@ -166,8 +166,8 @@ UI.box_append(hbox, vbox, 0)
166
166
  UI.box_append(hbox, histogram, 1)
167
167
 
168
168
  datapoints = Array.new(10) do
169
- UI.new_spinbox(0, 100).tap do |datapoint|
170
- UI.spinbox_set_value(datapoint, Random.new.rand(90))
169
+ LibUI.new_spinbox(0, 100).tap do |datapoint|
170
+ LibUI.spinbox_set_value(datapoint, Random.new.rand(90))
171
171
  UI.spinbox_on_changed(datapoint) {
172
172
  # Redraw the drawing area next:
173
173
  UI.area_queue_redraw_all(histogram)