Module: LibuiParadise
- Defined in:
- lib/libui_paradise/base/base.rb,
lib/libui_paradise/colours/colours.rb,
lib/libui_paradise/project/project.rb,
lib/libui_paradise/version/version.rb,
lib/libui_paradise/libui_classes/box.rb,
lib/libui_paradise/libui_classes/grid.rb,
lib/libui_paradise/prototype/prototype.rb,
lib/libui_paradise/extensions/extensions.rb,
lib/libui_paradise/libui_classes/libui_classes.rb,
lib/libui_paradise/extensions/toplevel_counters.rb,
lib/libui_paradise/generic_window/generic_window.rb,
lib/libui_paradise/examples/complex/010_table_example.rb,
lib/libui_paradise/requires/require_the_libui_classes.rb,
lib/libui_paradise/examples/complex/029_progressbar_example.rb,
lib/libui_paradise/examples/complex/032_simple_window_example.rb,
lib/libui_paradise/examples/complex/031_notification_functionality_example.rb,
lib/libui_paradise/examples/complex/033_daemonize_and_exit_after_delay_example.rb,
lib/libui_paradise/examples/complex/030_entry_responds_to_comment_as_synonymous_to_the_enter_key_pressed_example.rb
Overview
Defined Under Namespace
Modules: Extensions, GUI
Classes: Base, GenericWindow, NotificationFunctionalityExample
Constant Summary
collapse
- COLOR_BLUE =
#
COLOR_BLUE
This is actually dodgerblue.
#
0x1E90FF
- COLOR_MIDNIGHTBLUE =
0x191970
- COLOR_LIGHTSEAGREEN =
0x20b2aa
- PROJECT_BASE_DIRECTORY =
#
LibuiParadise::PROJECT_BASE_DIRECTORY
#
File.absolute_path("#{__dir__}/..")+'/'
- BASE_DIR =
PROJECT_BASE_DIRECTORY
- VERSION =
'0.3.9'
- LAST_UPDATE =
'12.12.2023'
Class Method Summary
collapse
-
.button(text) ⇒ Object
-
.checkbox(i = '') ⇒ Object
# === LibuiParadise.checkbox =========================================================================== #.
-
.colour_button ⇒ Object
-
.counter_left=(i = 1) ⇒ Object
# === LibuiParadise.counter_left= ========================================================================= #.
-
.counter_left? ⇒ Boolean
# === LibuiParadise.counter_left? ========================================================================= #.
-
.counter_top=(i = 1) ⇒ Object
# === LibuiParadise.counter_top= ========================================================================= #.
-
.counter_top? ⇒ Boolean
# === LibuiParadise.counter_top? ========================================================================= #.
-
.counters? ⇒ Boolean
# === LibuiParadise.counters? ========================================================================= #.
-
.create_grid ⇒ Object
# === LibuiParadise.create_grid =========================================================================== #.
-
.create_tab ⇒ Object
# === LibuiParadise.create_tab =========================================================================== #.
-
.do_require_the_libui_classes ⇒ Object
# === LibuiParadise.do_require_the_libui_classes.
-
.draw_rectangle(width = :default, height = :default, colour = :orange) ⇒ Object
# === LibuiParadise.draw_rectangle =========================================================================== #.
-
.editable_combobox(optional_array = nil, &block) ⇒ Object
# === LibuiParadise::Extensions.editable_combobox =========================================================================== #.
-
.entry(optional_text = '') ⇒ Object
# === LibuiParadise.entry =========================================================================== #.
-
.font(&block) ⇒ Object
# === LibuiParadise.font =========================================================================== #.
-
.font_button ⇒ Object
-
.generic_window(*use_these_widgets, &block) ⇒ Object
# === LibuiParadise.generic_window.
-
.hbox(*optional_widgets) ⇒ Object
# === LibuiParadise.hbox.
-
.horizontal_separator ⇒ Object
# === LibuiParadise.horizontal_separator ========================================================================= #.
-
.image(this_file, width = :try_to_infer_automatically, height = :infer_automatically) ⇒ Object
# === Libuiparadise.image ========================================================================= #.
-
.label(i = '') ⇒ Object
# === LibuiParadise.label.
-
.main_window? ⇒ Boolean
# === LibuiParadise.main_window? =========================================================================== #.
-
.menu(title = '') ⇒ Object
-
.msg_box(main_window = :default_window, title_to_use = '', whatever = '') ⇒ Object
# === LibuiParadise.msg_box =========================================================================== #.
-
.multiline_entry(optional_content = nil) ⇒ Object
# === LibuiParadise.multiline_entry =========================================================================== #.
-
.new_progress_bar ⇒ Object
# === LibuiParadise.new_progress_bar =========================================================================== #.
-
.non_wrapping_multiline_entry ⇒ Object
# === LibuiParadise.non_wrapping_multiline_entry =========================================================================== #.
-
.notification(text = 'Backup complete!', title_to_use = '') ⇒ Object
# === LibuiParadise.notification =========================================================================== #.
-
.open_file(main_window = LibuiParadise::Extensions.main_window?) ⇒ Object
# === LibuiParadise.open_file.
-
.padded_vbox ⇒ Object
# === LibuiParadise.padded_vbox =========================================================================== #.
-
.password_entry ⇒ Object
# === LibuiParadise.password_entry =========================================================================== #.
-
.project_base_dir? ⇒ Boolean
# === LibuiParadise.project_base_dir?.
-
.radio_buttons(optional_array = []) ⇒ Object
-
.register_this_fiddle_pointer_widget(the_fiddle_pointer_widget, the_type_of_the_widget = nil) ⇒ Object
-
.run_in_the_background ⇒ Object
# === LibuiParadise.run_in_the_background =========================================================================== #.
-
.scrolling_area(widget, width = :default, height = :default) ⇒ Object
-
.search_entry ⇒ Object
# === LibuiParadise.search_entry =========================================================================== #.
-
.set_main_window(i) ⇒ Object
# === LibuiParadise.set_main_window =========================================================================== #.
-
.slider(start_value = 0, end_value = 100) ⇒ Object
# === LibuiParadise.slider =========================================================================== #.
-
.spinbox(start_point = 0, end_point = 100, increment = 1) ⇒ Object
# === LibuiParadise.spinbox =========================================================================== #.
-
.string(i = '') ⇒ Object
# === LibuiParadise.string ========================================================================= #.
-
.table(i) ⇒ Object
# === LibuiParadise.table =========================================================================== #.
-
.text_layout(i = '') ⇒ Object
# === LibuiParadise.text_layout =========================================================================== #.
-
.vbox ⇒ Object
# === LibuiParadise.vbox =========================================================================== #.
-
.vertical_separator ⇒ Object
# === LibuiParadise.vertical_separator ========================================================================= #.
-
.window(the_title = '', width = 500, height = 300, has_menubar = 1) ⇒ Object
# === LibuiParadise.window =========================================================================== #.
Class Method Details
.checkbox(i = '') ⇒ Object
#
LibuiParadise.checkbox
#
.counter_left=(i = 1) ⇒ Object
#
LibuiParadise.counter_left=
#
31
32
33
|
# File 'lib/libui_paradise/extensions/toplevel_counters.rb', line 31
def self.counter_left=(i = 1)
@counter_left = i
end
|
.counter_left? ⇒ Boolean
#
LibuiParadise.counter_left?
#
22
23
24
|
# File 'lib/libui_paradise/extensions/toplevel_counters.rb', line 22
def self.counter_left?
@counter_left
end
|
.counter_top=(i = 1) ⇒ Object
#
LibuiParadise.counter_top=
#
47
48
49
|
# File 'lib/libui_paradise/extensions/toplevel_counters.rb', line 47
def self.counter_top=(i = 1)
@counter_top = i
end
|
.counter_top? ⇒ Boolean
#
LibuiParadise.counter_top?
#
38
39
40
|
# File 'lib/libui_paradise/extensions/toplevel_counters.rb', line 38
def self.counter_top?
@counter_top
end
|
.counters? ⇒ Boolean
#
LibuiParadise.counters?
#
54
55
56
|
# File 'lib/libui_paradise/extensions/toplevel_counters.rb', line 54
def self.counters?
return [@counter_left, @counter_top]
end
|
.create_grid ⇒ Object
#
LibuiParadise.create_grid
#
1629
1630
1631
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1629
def self.create_grid
::LibUI.new_grid
end
|
.create_tab ⇒ Object
#
LibuiParadise.create_tab
#
1622
1623
1624
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1622
def self.create_tab
LibuiParadise::Extensions.tab
end
|
.do_require_the_libui_classes ⇒ Object
#
LibuiParadise.do_require_the_libui_classes
This method will batch-require all libui-paradise classes under the libui_classes/ subdirectory.
#
17
18
19
20
21
22
23
|
# File 'lib/libui_paradise/requires/require_the_libui_classes.rb', line 17
def self.do_require_the_libui_classes
target = LibuiParadise.project_base_dir?+'libui_classes/*.rb'
files_that_are_to_be_required = Dir[target]
files_that_are_to_be_required.each {|this_file|
require "libui_paradise/libui_classes/#{File.basename(this_file)}"
}
end
|
.draw_rectangle(width = :default, height = :default, colour = :orange) ⇒ Object
#
LibuiParadise.draw_rectangle
#
.editable_combobox(optional_array = nil, &block) ⇒ Object
#
LibuiParadise::Extensions.editable_combobox
#
.entry(optional_text = '') ⇒ Object
1606
1607
1608
1609
1610
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1606
def self.entry(
optional_text = ''
)
::LibuiParadise::Extensions.entry(optional_text)
end
|
.generic_window(*use_these_widgets, &block) ⇒ Object
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
|
# File 'lib/libui_paradise/extensions/extensions.rb', line 917
def self.generic_window(
*use_these_widgets,
&block
)
unless LibuiParadise.respond_to?(:GenericWindow)
require 'libui_paradise/generic_window/generic_window.rb'
end
generic_window = LibuiParadise::GenericWindow.new { :do_not_run_yet }
if block_given?
yielded = yield
if yielded.is_a? Hash
if yielded.has_key?(:height)
generic_window.set_height(
yielded[:height]
)
generic_window.update_the_main_window
end
if yielded.has_key?(:width)
generic_window.set_width(
yielded[:width]
)
generic_window.update_the_main_window
end
if yielded.has_key?(:title)
generic_window.set_title(
yielded[:title]
)
generic_window.update_the_main_window
end
end
end
use_these_widgets.flatten!
use_these_widgets.compact!
if use_these_widgets.is_a?(Array) and !use_these_widgets.empty?
generic_window.add_these_widgets(use_these_widgets)
end
return generic_window
end
|
.hbox(*optional_widgets) ⇒ Object
#
LibuiParadise.hbox
This toplevel-method can be used to instantiate a new hbox.
#
135
136
137
|
# File 'lib/libui_paradise/libui_classes/box.rb', line 135
def self.hbox(*optional_widgets)
::LibuiParadise::Extensions.hbox(optional_widgets)
end
|
.horizontal_separator ⇒ Object
#
LibuiParadise.horizontal_separator
#
.image(this_file, width = :try_to_infer_automatically, height = :infer_automatically) ⇒ Object
1563
1564
1565
1566
1567
1568
1569
1570
1571
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1563
def self.image(
this_file,
width = :try_to_infer_automatically,
height = :infer_automatically
)
::LibuiParadise::Extensions.image(
this_file, width, height
)
end
|
.label(i = '') ⇒ Object
#
LibuiParadise.label
Toplevel method to create a new label, aka new text.
#
.main_window? ⇒ Boolean
#
LibuiParadise.main_window?
#
1556
1557
1558
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1556
def self.(title = '')
return LibuiParadise::Extensions.(title)
end
|
.msg_box(main_window = :default_window, title_to_use = '', whatever = '') ⇒ Object
#
LibuiParadise.msg_box
#
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1456
def self.msg_box(
main_window = :default_window,
title_to_use = '',
whatever = ''
)
if main_window.is_a?(String) and title_to_use.is_a?(String) and
title_to_use.empty?
title_to_use = main_window.dup
main_window = :default_window
end
::LibuiParadise::Extensions.msg_box(
main_window,
title_to_use,
whatever
)
end
|
.multiline_entry(optional_content = nil) ⇒ Object
#
LibuiParadise.multiline_entry
#
.new_progress_bar ⇒ Object
#
LibuiParadise.new_progress_bar
#
1480
1481
1482
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1480
def self.new_progress_bar
return ::LibuiParadise::Extensions.new_progress_bar
end
|
.non_wrapping_multiline_entry ⇒ Object
#
LibuiParadise.non_wrapping_multiline_entry
#
.notification(text = 'Backup complete!', title_to_use = '') ⇒ Object
#
LibuiParadise.notification
#
885
886
887
888
889
890
891
892
893
894
|
# File 'lib/libui_paradise/extensions/extensions.rb', line 885
def self.notification(
text = 'Backup complete!',
title_to_use = ''
)
::LibuiParadise::Extensions.message_box(
:default_window,
text,
title_to_use
)
end
|
.open_file(main_window = LibuiParadise::Extensions.main_window?) ⇒ Object
#
LibuiParadise.open_file
This method is a simple delegator towards the LibuiParadise::Extensions.open_file() functionality.
#
.padded_vbox ⇒ Object
#
LibuiParadise.padded_vbox
#
143
144
145
146
147
|
# File 'lib/libui_paradise/libui_classes/box.rb', line 143
def self.padded_vbox
_ = ::LibuiParadise::Extensions.vbox
_.is_padded
return _
end
|
.password_entry ⇒ Object
#
LibuiParadise.password_entry
#
.project_base_dir? ⇒ Boolean
#
LibuiParadise.project_base_dir?
Preferentially use this method rather than the constant above directly.
#
22
23
24
|
# File 'lib/libui_paradise/project/project.rb', line 22
def self.project_base_dir?
PROJECT_BASE_DIRECTORY
end
|
.run_in_the_background ⇒ Object
#
LibuiParadise.run_in_the_background
#
878
879
880
|
# File 'lib/libui_paradise/extensions/extensions.rb', line 878
def self.run_in_the_background
Process.daemon
end
|
.search_entry ⇒ Object
#
LibuiParadise.search_entry
#
.set_main_window(i) ⇒ Object
#
LibuiParadise.set_main_window
#
.slider(start_value = 0, end_value = 100) ⇒ Object
1432
1433
1434
1435
1436
1437
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1432
def self.slider(
start_value = 0,
end_value = 100
)
::LibuiParadise::Extensions.slider(start_value, end_value)
end
|
.spinbox(start_point = 0, end_point = 100, increment = 1) ⇒ Object
#
LibuiParadise.spinbox
#
1419
1420
1421
1422
1423
1424
1425
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1419
def self.spinbox(
start_point = 0,
end_point = 100,
increment = 1 )
::LibuiParadise::Extensions.spinbox(start_point, end_point)
end
|
.string(i = '') ⇒ Object
1405
1406
1407
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1405
def self.string(i = '')
return ::LibUI.new_attributed_string(i)
end
|
.text_layout(i = '') ⇒ Object
#
LibuiParadise.text_layout
#
.vertical_separator ⇒ Object
#
LibuiParadise.vertical_separator
#
.window(the_title = '', width = 500, height = 300, has_menubar = 1) ⇒ Object
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
|
# File 'lib/libui_paradise/libui_classes/libui_classes.rb', line 1351
def self.window(
the_title = '', width = 500, height = 300, = 1 )
::LibuiParadise::Extensions.window(
the_title,
width,
height,
)
end
|