gtk_paradise 0.9.120 → 0.11.19
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gtk_paradise might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +4521 -2997
- data/bin/genity +26 -0
- data/bin/gtk_editor +7 -0
- data/doc/README.gen +4484 -2975
- data/doc/todo/TODO_FOR_THE_GTK_PARADISE_PROJECT.md +281 -218
- data/doc/todo/recurring_todo_tasks.md +4 -3
- data/gtk_paradise.gemspec +28 -17
- data/lib/gtk_paradise/app/app.rb +77 -45
- data/lib/gtk_paradise/app/{app_module.rb → app_module/app_module.rb} +1064 -899
- data/lib/gtk_paradise/base_module/base_module.rb +7043 -33
- data/lib/gtk_paradise/base_module/class_methods/class_methods.rb +0 -0
- data/lib/gtk_paradise/base_module/css.rb +200 -268
- data/lib/gtk_paradise/base_module/experimental.rb +119 -0
- data/lib/gtk_paradise/base_module/html_support.rb +40 -15
- data/lib/gtk_paradise/base_module/these_methods_work_for_gtk3_and_gtk4.rb +155 -0
- data/lib/gtk_paradise/base_module_and_app_module/base_module_and_app_module.rb +1 -1
- data/lib/gtk_paradise/colours/colour_palette/material_design.rb +239 -0
- data/lib/gtk_paradise/colours/gtk_colour_constants.rb +8 -2
- data/lib/gtk_paradise/colours/parse.rb +8 -1
- data/lib/gtk_paradise/commandline/commandline.rb +20 -19
- data/lib/gtk_paradise/constants/constants.rb +227 -7
- data/lib/gtk_paradise/css_files/borders.css +81 -0
- data/lib/gtk_paradise/css_files/colours.css +329 -328
- data/lib/gtk_paradise/css_files/css_accordion.css +6 -2
- data/lib/gtk_paradise/css_files/hover_effects.css +588 -0
- data/lib/gtk_paradise/css_files/project.css +153 -189
- data/lib/gtk_paradise/drawing/README.md +3 -0
- data/lib/gtk_paradise/drawing/drawing.rb +68 -0
- data/lib/gtk_paradise/{base_module/colours.rb → drawing/event.rb} +37 -45
- data/lib/gtk_paradise/drawing/star.rb +96 -0
- data/lib/gtk_paradise/drawing/tool.rb +268 -0
- data/lib/gtk_paradise/drawing/turtle.rb +138 -0
- data/lib/gtk_paradise/emojis/emojis.rb +14 -13
- data/lib/gtk_paradise/examples/advanced/001_5x5_grid_example.rb +35 -50
- data/lib/gtk_paradise/examples/advanced/002_advanced_drag_and_drop_example.rb +21 -13
- data/lib/gtk_paradise/examples/advanced/003_html_like_support.rb +4 -25
- data/lib/gtk_paradise/examples/advanced/004_on_hover_example_on_gtk_entry.rb +4 -4
- data/lib/gtk_paradise/examples/advanced/005_csv_example.rb +6 -2
- data/lib/gtk_paradise/examples/advanced/007_label_responding_to_events_example.rb +1 -10
- data/lib/gtk_paradise/examples/advanced/008_options_example.rb +6 -3
- data/lib/gtk_paradise/examples/advanced/009_key_events.rb +1 -1
- data/lib/gtk_paradise/examples/advanced/010_extensive_text_view_example.rb +18 -17
- data/lib/gtk_paradise/examples/advanced/011_moving_blocks_example.rb +3 -3
- data/lib/gtk_paradise/examples/advanced/012_cell_data_sorting_example.rb +3 -4
- data/lib/gtk_paradise/examples/advanced/013_advanced_css_example.rb +86 -49
- data/lib/gtk_paradise/examples/advanced/014_popup_example.rb +9 -9
- data/lib/gtk_paradise/examples/advanced/015_advanced_button_example.rb +7 -19
- data/lib/gtk_paradise/examples/advanced/017_lean_CSS_example.rb +10 -13
- data/lib/gtk_paradise/examples/advanced/018_coloured_text_example.rb +7 -13
- data/lib/gtk_paradise/examples/advanced/019_gtk_entry_showing_the_cursor_position.rb +1 -1
- data/lib/gtk_paradise/examples/advanced/020_scale_this_image.rb +1 -10
- data/lib/gtk_paradise/examples/advanced/021_scroll_events_on_gtk_entry.rb +4 -0
- data/lib/gtk_paradise/examples/advanced/022_autogenerated_CSS_rounded_borders.rb +142 -0
- data/lib/gtk_paradise/examples/advanced/023_append_image_to_buffer.rb +145 -0
- data/lib/gtk_paradise/examples/advanced/024_notebook_with_tab_example.rb +151 -0
- data/lib/gtk_paradise/examples/advanced/025_showing_a_gold_caret_on_black_background.rb +144 -0
- data/lib/gtk_paradise/examples/advanced/026_status_bar_example.rb +153 -0
- data/lib/gtk_paradise/examples/advanced/027_customized_frame_example.rb +141 -0
- data/lib/gtk_paradise/examples/advanced/028_widgets_described_in_a_yaml_file.rb +240 -0
- data/lib/gtk_paradise/examples/cairo/basic_cairo_shapes.rb +1 -1
- data/lib/gtk_paradise/examples/cairo/cairo_transparent_rectangles.rb +9 -5
- data/lib/gtk_paradise/examples/cairo/cairo_write_via_custom_font.rb +81 -0
- data/lib/gtk_paradise/examples/cairo/donut_shape.rb +19 -6
- data/lib/gtk_paradise/examples/cairo/ping_pong_game.rb +2 -3
- data/lib/gtk_paradise/examples/controller/README.md +4 -0
- data/lib/gtk_paradise/examples/controller/controller.rb +2 -0
- data/lib/gtk_paradise/examples/css/001_border_examples.rb +30 -13
- data/lib/gtk_paradise/examples/css/002_import_CSS_file.rb +10 -5
- data/lib/gtk_paradise/examples/drawing/001_example.rb +61 -0
- data/lib/gtk_paradise/examples/drawing/002_example.rb +51 -0
- data/lib/gtk_paradise/examples/drawing/003_example.rb +38 -0
- data/lib/gtk_paradise/examples/drawing/004_example.rb +36 -0
- data/lib/gtk_paradise/examples/drawing/005_example.rb +92 -0
- data/lib/gtk_paradise/examples/drawing/006_example.rb +58 -0
- data/lib/gtk_paradise/examples/drawing/007_example.rb +22 -0
- data/lib/gtk_paradise/examples/drawing/008_example.rb +43 -0
- data/lib/gtk_paradise/examples/drawing/009_example.rb +43 -0
- data/lib/gtk_paradise/examples/drawing/010_example.rb +25 -0
- data/lib/gtk_paradise/examples/drawing/011_example.rb +72 -0
- data/lib/gtk_paradise/examples/drawing/012_example.rb +59 -0
- data/lib/gtk_paradise/examples/drawing/README.md +3 -0
- data/lib/gtk_paradise/examples/drawing/moving_turtle_example.rb +43 -0
- data/lib/gtk_paradise/examples/gdk/001_gdk_screen_properties.rb +58 -0
- data/lib/gtk_paradise/examples/gdk_pixbuf/save_image_example.rb +1 -1
- data/lib/gtk_paradise/examples/gir_ffi/001_hello_world.rb +29 -0
- data/lib/gtk_paradise/examples/gir_ffi/002_upgraded_hello_world.rb +40 -0
- data/lib/gtk_paradise/examples/gir_ffi/003_gtk_application_example.rb +30 -0
- data/lib/gtk_paradise/examples/gir_ffi/004_treeview_example.rb +64 -0
- data/lib/gtk_paradise/examples/gir_ffi/005_complex_example.rb +104 -0
- data/lib/gtk_paradise/examples/gir_ffi/README.md +5 -0
- data/lib/gtk_paradise/examples/glib/parse_glib_settings.rb +1 -1
- data/lib/gtk_paradise/examples/gtk2/008_list_store_example.rb +1 -1
- data/lib/gtk_paradise/examples/gtk3/{061_gtk_entry.rb → 001_gtk_entry.rb} +11 -6
- data/lib/gtk_paradise/examples/gtk3/{009_scrolled_window_example.rb → 002_scrolled_window_example.rb} +6 -4
- data/lib/gtk_paradise/examples/gtk3/{062_toggle_button_example.rb → 003_toggle_button_example.rb} +3 -2
- data/lib/gtk_paradise/examples/gtk3/{081_simple_dialog_example.rb → 004_simple_dialog_example.rb} +19 -12
- data/lib/gtk_paradise/examples/gtk3/005_spinner_example.rb +30 -10
- data/lib/gtk_paradise/examples/gtk3/006_text_view_example.rb +78 -0
- data/lib/gtk_paradise/examples/gtk3/{079_two_windows_example.rb → 007_two_windows_example.rb} +3 -1
- data/lib/gtk_paradise/examples/gtk3/008_search_bar_example.rb +91 -0
- data/lib/gtk_paradise/examples/gtk3/{002_simple_window.rb → 009_simple_window.rb} +14 -6
- data/lib/gtk_paradise/examples/gtk3/{025_switch_example.rb → 010_switch_example.rb} +6 -7
- data/lib/gtk_paradise/examples/gtk3/011_colour_chooser_example.rb +71 -0
- data/lib/gtk_paradise/examples/gtk3/012_show_the_xid_example.rb +18 -0
- data/lib/gtk_paradise/examples/gtk3/013_grab_pointer_forcefully.rb +31 -0
- data/lib/gtk_paradise/examples/gtk3/{083_bottom_left_placement.rb → 015_bottom_left_placement.rb} +3 -1
- data/lib/gtk_paradise/examples/gtk3/{082_scrolling_example.rb → 016_scrolling_example.rb} +2 -2
- data/lib/gtk_paradise/examples/gtk3/{080_extensive_markup_example.rb → 017_extensive_markup_example.rb} +8 -7
- data/lib/gtk_paradise/examples/gtk3/{078_message_dialog_example.rb → 018_message_dialog_example.rb} +3 -5
- data/lib/gtk_paradise/examples/gtk3/{075_tiny_button_via_css.rb → 021_tiny_button_via_css.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{001_font_related_information.rb → 022_font_related_information.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/023_sorted_tree.rb +166 -0
- data/lib/gtk_paradise/examples/gtk3/{004_small_paned_example.rb → 024_small_paned_example.rb} +4 -3
- data/lib/gtk_paradise/examples/gtk3/{007_progress_bar_example.rb → 026_progress_bar_example.rb} +1 -2
- data/lib/gtk_paradise/examples/gtk3/{008_menubar_example.rb → 027_menubar_example.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{010_paned_widget_example.rb → 028_paned_widget_example.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{011_sockets.rb → 029_sockets.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{012_notebook_example.rb → 030_notebook_example.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{013_icon_theme_example.rb → 031_icon_theme_example.rb} +6 -0
- data/lib/gtk_paradise/examples/gtk3/{014_switcher_window.rb → 032_switcher_window.rb} +16 -10
- data/lib/gtk_paradise/examples/gtk3/{016_hello_world_in_gtk3_and_bold_font.rb → 034_hello_world_in_gtk3_and_bold_font.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{017_grid_example.rb → 035_grid_example.rb} +5 -1
- data/lib/gtk_paradise/examples/gtk3/{018_buttons_showcasing_the_relief.rb → 036_buttons_showcasing_the_relief.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{019_text_buffer_example.rb → 037_text_buffer_example.rb} +12 -10
- data/lib/gtk_paradise/examples/gtk3/{022_popup_example.rb → 040_popup_example.rb} +2 -2
- data/lib/gtk_paradise/examples/gtk3/{023_horizontal_and_vertical_scale.rb → 041_horizontal_and_vertical_scale.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{026_hover_button_example_via_css.rb → 043_hover_button_example_via_css.rb} +3 -1
- data/lib/gtk_paradise/examples/gtk3/{027_spin_button_example.rb → 044_spin_button_example.rb} +4 -3
- data/lib/gtk_paradise/examples/gtk3/{028_radio_menu_item_example.rb → 045_radio_menu_item_example.rb} +4 -1
- data/lib/gtk_paradise/examples/gtk3/{029_gtk_dialog_sample.rb → 046_gtk_dialog_sample.rb} +4 -1
- data/lib/gtk_paradise/examples/gtk3/{030_draw_rectangles.rb → 047_draw_rectangles.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{031_colour_choose_button.rb → 048_colour_choose_button.rb} +17 -3
- data/lib/gtk_paradise/examples/gtk3/{032_drag_and_drop_example.rb → 049_drag_and_drop_example.rb} +13 -5
- data/lib/gtk_paradise/examples/gtk3/{033_cell_renderer_pixbuf_example.rb → 050_cell_renderer_pixbuf_example.rb} +17 -6
- data/lib/gtk_paradise/examples/gtk3/051_combo_box_example.rb +74 -0
- data/lib/gtk_paradise/examples/gtk3/{037_css_example_of_a_button_changing_the_background_colour_on_click_event.rb → 053_css_example_of_a_button_changing_the_background_colour_on_click_event.rb} +14 -4
- data/lib/gtk_paradise/examples/gtk3/{036_revealer_example.rb → 053_revealer_example.rb} +10 -6
- data/lib/gtk_paradise/examples/gtk3/{038_ten_labels_in_a_vertical_box_example.rb → 054_ten_labels_in_a_vertical_box_example.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{039_threads_example.rb → 055_threads_example.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{042_colourized_button_example.rb → 058_colourized_button_example.rb} +1 -2
- data/lib/gtk_paradise/examples/gtk3/{043_form_example.rb → 059_form_example.rb} +1 -3
- data/lib/gtk_paradise/examples/gtk3/{044_check_button.rb → 060_check_button.rb} +4 -2
- data/lib/gtk_paradise/examples/gtk3/{046_event_box_example.rb → 062_event_box_example.rb} +2 -1
- data/lib/gtk_paradise/examples/gtk3/{047_examples_with_css.rb → 063_examples_with_css.rb} +91 -3
- data/lib/gtk_paradise/examples/gtk3/{048_accel_group_example.rb → 064_accel_group_example.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{049_change_the_application_theme.rb → 065_change_the_application_theme.rb} +4 -2
- data/lib/gtk_paradise/examples/gtk3/{050_header_bar_example.rb → 066_header_bar_example.rb} +3 -0
- data/lib/gtk_paradise/examples/gtk3/{051_gtk_label_example.rb → 067_gtk_label_example.rb} +3 -2
- data/lib/gtk_paradise/examples/gtk3/{052_popover_example.rb → 068_popover_example.rb} +2 -2
- data/lib/gtk_paradise/examples/gtk3/{053_entry_completion.rb → 069_entry_completion.rb} +2 -0
- data/lib/gtk_paradise/examples/gtk3/{055_button_demo.rb → 071_button_demo.rb} +6 -5
- data/lib/gtk_paradise/examples/gtk3/{056_text_iterator_example.rb → 072_text_iterator_example.rb} +30 -21
- data/lib/gtk_paradise/examples/gtk3/{057_image_example.rb → 073_image_example.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{058_frame_example.rb → 074_frame_example.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{059_gtk_expander.rb → 075_gtk_expander.rb} +2 -0
- data/lib/gtk_paradise/examples/gtk3/{060_ten_vboxes_example.rb → 076_ten_vboxes_example.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{063_button_box_example.rb → 077_button_box_example.rb} +11 -1
- data/lib/gtk_paradise/examples/gtk3/{064_tree_view_column_example.rb → 078_tree_view_column_example.rb} +2 -1
- data/lib/gtk_paradise/examples/gtk3/{066_vertical_boxes.rb → 080_vertical_boxes.rb} +2 -1
- data/lib/gtk_paradise/examples/gtk3/{067_vbox_with_spacing_and_border_width.rb → 081_vbox_with_spacing_and_border_width.rb} +2 -1
- data/lib/gtk_paradise/examples/gtk3/{069_file_chooser_dialog.rb → 082_file_chooser_dialog.rb} +3 -0
- data/lib/gtk_paradise/examples/gtk3/{070_bindings.rb → 083_bindings.rb} +14 -8
- data/lib/gtk_paradise/examples/gtk3/{072_recent_chooser_dialog.rb → 084_recent_chooser_dialog.rb} +2 -2
- data/lib/gtk_paradise/examples/gtk3/{073_showcase_the_cursors.rb → 085_showcase_the_cursors.rb} +30 -5
- data/lib/gtk_paradise/examples/gtk3/{074_app_chooser_button_example.rb → 086_app_chooser_button_example.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/087_calendar_example.rb +41 -0
- data/lib/gtk_paradise/examples/gtk4/001_gtk_entry.rb +88 -0
- data/lib/gtk_paradise/examples/gtk4/002_scrolled_window_example.rb +62 -0
- data/lib/gtk_paradise/examples/gtk4/003_toggle_button_example.rb +23 -0
- data/lib/gtk_paradise/examples/gtk4/004_simple_dialog_example.rb +41 -0
- data/lib/gtk_paradise/examples/gtk4/005_spinner_example.rb +64 -0
- data/lib/gtk_paradise/examples/gtk4/006_text_view_example.rb +77 -0
- data/lib/gtk_paradise/examples/gtk4/007_two_windows_example.rb +55 -0
- data/lib/gtk_paradise/examples/gtk4/008_search_bar_example.rb +88 -0
- data/lib/gtk_paradise/examples/gtk4/009_text_view_example.rb +30 -0
- data/lib/gtk_paradise/examples/gtk4/010_switch_example.rb +52 -0
- data/lib/gtk_paradise/examples/gtk4/074_frame_example.rb +105 -0
- data/lib/gtk_paradise/examples/gtk4/076_ten_vboxes_example.rb +35 -0
- data/lib/gtk_paradise/examples/gtk4/087_calendar_example.rb +47 -0
- data/lib/gtk_paradise/examples/gtk4/100_changed_events_example.rb +77 -0
- data/lib/gtk_paradise/examples/gtk4/101_actionbar_example.rb +55 -0
- data/lib/gtk_paradise/examples/gtk4/102_picture_example.rb +35 -0
- data/lib/gtk_paradise/examples/pango/pango_power.rb +1 -0
- data/lib/gtk_paradise/experimental/experimental.rb +3 -11
- data/lib/gtk_paradise/experimental/experimental_for_gtk4.rb +92 -0
- data/lib/gtk_paradise/fonts/fonts.rb +5 -1
- data/lib/gtk_paradise/gdk/cursor.rb +2 -2
- data/lib/gtk_paradise/{base_module/e.rb → gdk/event_crossing.rb} +6 -8
- data/lib/gtk_paradise/gdk/gdk.rb +1 -1
- data/lib/gtk_paradise/gtk_classes/about.rb +11 -2
- data/lib/gtk_paradise/gtk_classes/about_dialog.rb +6 -2
- data/lib/gtk_paradise/gtk_classes/alignment.rb +4 -1
- data/lib/gtk_paradise/gtk_classes/application.rb +94 -4
- data/lib/gtk_paradise/gtk_classes/application_window.rb +25 -0
- data/lib/gtk_paradise/gtk_classes/box.rb +116 -279
- data/lib/gtk_paradise/gtk_classes/button.rb +55 -37
- data/lib/gtk_paradise/gtk_classes/button_box.rb +9 -1
- data/lib/gtk_paradise/gtk_classes/cell_renderer_text.rb +5 -3
- data/lib/gtk_paradise/gtk_classes/check_button.rb +27 -8
- data/lib/gtk_paradise/gtk_classes/combo_box.rb +4 -1
- data/lib/gtk_paradise/gtk_classes/combo_box_entry.rb +17 -11
- data/lib/gtk_paradise/gtk_classes/combo_box_text.rb +21 -19
- data/lib/gtk_paradise/gtk_classes/dialog.rb +2 -2
- data/lib/gtk_paradise/gtk_classes/entry.rb +256 -124
- data/lib/gtk_paradise/gtk_classes/entry_completion.rb +4 -0
- data/lib/gtk_paradise/gtk_classes/event_box.rb +21 -2
- data/lib/gtk_paradise/gtk_classes/event_button.rb +1 -1
- data/lib/gtk_paradise/gtk_classes/expander.rb +8 -1
- data/lib/gtk_paradise/gtk_classes/file_chooser_dialog.rb +1 -1
- data/lib/gtk_paradise/gtk_classes/file_filter.rb +4 -2
- data/lib/gtk_paradise/gtk_classes/file_selection.rb +4 -3
- data/lib/gtk_paradise/gtk_classes/frame.rb +19 -1
- data/lib/gtk_paradise/gtk_classes/grid.rb +206 -160
- data/lib/gtk_paradise/gtk_classes/hbox.rb +145 -0
- data/lib/gtk_paradise/gtk_classes/header_bar.rb +19 -8
- data/lib/gtk_paradise/gtk_classes/image.rb +1 -1
- data/lib/gtk_paradise/gtk_classes/label.rb +174 -135
- data/lib/gtk_paradise/gtk_classes/menu.rb +7 -3
- data/lib/gtk_paradise/gtk_classes/menu_bar.rb +1 -1
- data/lib/gtk_paradise/gtk_classes/menu_item.rb +1 -1
- data/lib/gtk_paradise/gtk_classes/notebook.rb +114 -64
- data/lib/gtk_paradise/gtk_classes/paned.rb +52 -0
- data/lib/gtk_paradise/gtk_classes/radio_menu_item.rb +19 -1
- data/lib/gtk_paradise/gtk_classes/scale_button.rb +16 -1
- data/lib/gtk_paradise/gtk_classes/scrolled_window.rb +8 -6
- data/lib/gtk_paradise/gtk_classes/search_bar.rb +1 -1
- data/lib/gtk_paradise/gtk_classes/source_buffer.rb +4 -5
- data/lib/gtk_paradise/gtk_classes/spin_button.rb +9 -1
- data/lib/gtk_paradise/gtk_classes/spinner.rb +32 -2
- data/lib/gtk_paradise/gtk_classes/status_icon.rb +2 -0
- data/lib/gtk_paradise/gtk_classes/statusbar.rb +1 -0
- data/lib/gtk_paradise/gtk_classes/style_context.rb +71 -0
- data/lib/gtk_paradise/gtk_classes/text_buffer.rb +45 -19
- data/lib/gtk_paradise/gtk_classes/text_view.rb +20 -3
- data/lib/gtk_paradise/gtk_classes/toggle_button.rb +3 -0
- data/lib/gtk_paradise/gtk_classes/toolbar.rb +2 -2
- data/lib/gtk_paradise/gtk_classes/tree_iter.rb +1 -1
- data/lib/gtk_paradise/gtk_classes/tree_view.rb +93 -70
- data/lib/gtk_paradise/gtk_classes/tree_view_column.rb +2 -1
- data/lib/gtk_paradise/gtk_classes/vbox.rb +71 -10
- data/lib/gtk_paradise/gtk_classes/vscale.rb +2 -2
- data/lib/gtk_paradise/gtk_classes/widget.rb +1057 -590
- data/lib/gtk_paradise/gtk_classes/window.rb +37 -2
- data/lib/gtk_paradise/hello_world/README.md +1 -1
- data/lib/gtk_paradise/hello_world/hello_world_gtk4.rb +20 -0
- data/lib/gtk_paradise/images/icons/close_image.png +0 -0
- data/lib/gtk_paradise/images/icons/closed.png +0 -0
- data/lib/gtk_paradise/images/icons/directory.png +0 -0
- data/lib/gtk_paradise/images/icons/icon_cool.gif +0 -0
- data/lib/gtk_paradise/images/icons/icon_lol.gif +0 -0
- data/lib/gtk_paradise/images/icons/icon_smile.gif +0 -0
- data/lib/gtk_paradise/images/icons/opened.png +0 -0
- data/lib/gtk_paradise/images/internal/gtk_label_example.png +0 -0
- data/lib/gtk_paradise/images/misc/wiki_logo.png +0 -0
- data/lib/gtk_paradise/images/small/GREEN_CIRCLE.png +0 -0
- data/lib/gtk_paradise/images/small/README.md +2 -0
- data/lib/gtk_paradise/images/small/RED_CIRCLE.png +0 -0
- data/lib/gtk_paradise/pango/{pango_fonts.rb → fonts.rb} +2 -2
- data/lib/gtk_paradise/pango/{pango.rb → layout.rb} +1 -1
- data/lib/gtk_paradise/pango/pango_renderer.rb +9 -2
- data/lib/gtk_paradise/project/project.rb +4 -3
- data/lib/gtk_paradise/prototypes/README.md +8 -0
- data/lib/gtk_paradise/prototypes/gtk3_standalone.rb +8 -21
- data/lib/gtk_paradise/prototypes/gtk4_standalone.rb +135 -0
- data/lib/gtk_paradise/prototypes/shared_code.rb +5 -15
- data/lib/gtk_paradise/prototypes/unified_gtk_prototype.rb +179 -0
- data/lib/gtk_paradise/require_gtk4.rb +7 -0
- data/lib/gtk_paradise/requires/require_base_module.rb +7 -0
- data/lib/gtk_paradise/requires/require_files_irrespective_of_the_gtk_version_at_hand.rb +25 -16
- data/lib/gtk_paradise/requires/require_gtk2.rb +6 -4
- data/lib/gtk_paradise/requires/{require_gtk2_or_gtk3.rb → require_gtk2_or_gtk3_or_gtk4.rb} +33 -12
- data/lib/gtk_paradise/requires/require_gtk3.rb +5 -20
- data/lib/gtk_paradise/requires/require_gtk4.rb +13 -0
- data/lib/gtk_paradise/requires/require_gtk_runner.rb +1 -0
- data/lib/gtk_paradise/requires/require_the_base_module_and_gtk_run.rb +1 -1
- data/lib/gtk_paradise/requires/require_the_base_module_the_app_module_and_the_toplevel_methods.rb +9 -0
- data/lib/gtk_paradise/requires/require_the_classes_files_for_gtk4.rb +11 -0
- data/lib/gtk_paradise/requires/require_the_colours_gem.rb +9 -0
- data/lib/gtk_paradise/requires/require_the_default_gtk_version.rb +4 -2
- data/lib/gtk_paradise/requires/require_the_toplevel_methods.rb +1 -1
- data/lib/gtk_paradise/run.rb +1 -0
- data/lib/gtk_paradise/run_this_widget/run_this_widget.rb +7 -3
- data/lib/gtk_paradise/threads/threads.rb +15 -10
- data/lib/gtk_paradise/toplevel_methods/css.rb +183 -35
- data/lib/gtk_paradise/toplevel_methods/cursor.rb +17 -3
- data/lib/gtk_paradise/toplevel_methods/determine_which_gtk_version_is_in_use.rb +90 -8
- data/lib/gtk_paradise/toplevel_methods/events.rb +6 -0
- data/lib/gtk_paradise/toplevel_methods/keys.rb +1 -1
- data/lib/gtk_paradise/toplevel_methods/screen_resolution.rb +32 -5
- data/lib/gtk_paradise/toplevel_methods/text_buffer_tags.rb +13 -4
- data/lib/gtk_paradise/toplevel_methods/tokenizer.rb +18 -3
- data/lib/gtk_paradise/toplevel_methods/{misc.rb → toplevel_methods.rb} +728 -181
- data/lib/gtk_paradise/utility_scripts/commandline_to_automatic_gui.rb +244 -0
- data/lib/gtk_paradise/version/version.rb +2 -2
- data/lib/gtk_paradise/widgets/gtk2/cat_merge.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk2/cell_renderer_progress_example.rb +0 -5
- data/lib/gtk_paradise/widgets/gtk2/foto_lister.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk2/gidnight_commander/gidnight_commander.rb +3 -3
- data/lib/gtk_paradise/widgets/gtk2/hbox_example.rb +1 -5
- data/lib/gtk_paradise/widgets/gtk2/multiple_select_in_a_tree_view_widget.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk2/paned_example.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk2/slider_changing_button.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk2/status_icon_example.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk2/table2.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk2/toolbar_example.rb +2 -6
- data/lib/gtk_paradise/widgets/{version_agnostic → gtk3/audio_button}/audio_button.rb +15 -26
- data/lib/gtk_paradise/widgets/gtk3/burn_this_iso_file/burn_this_iso_file.rb +2 -6
- data/lib/gtk_paradise/widgets/{version_agnostic → gtk3/button_open_remote_webpage}/button_open_remote_webpage.rb +105 -50
- data/lib/gtk_paradise/widgets/gtk3/button_with_border/button_with_border.rb +155 -0
- data/lib/gtk_paradise/widgets/{version_agnostic → gtk3/button_xorg_buffer}/button_xorg_buffer.rb +76 -18
- data/lib/gtk_paradise/widgets/gtk3/calculator/calculator.rb +183 -76
- data/lib/gtk_paradise/widgets/gtk3/checkbox_image/checkbox_image.rb +3 -7
- data/lib/gtk_paradise/widgets/{version_agnostic → gtk3/coloured_button}/coloured_button.rb +94 -24
- data/lib/gtk_paradise/widgets/gtk3/coloured_square/coloured_square.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk3/coloured_unit/coloured_unit.rb +151 -0
- data/lib/gtk_paradise/widgets/gtk3/cpu_widget/cpu_widget.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk3/directory_content_widget/directory_content_widget.rb +937 -7
- data/lib/gtk_paradise/widgets/gtk3/editor/connect_skeleton.rb +33 -38
- data/lib/gtk_paradise/widgets/gtk3/editor/create.rb +66 -41
- data/lib/gtk_paradise/widgets/gtk3/editor/editor.rb +256 -270
- data/lib/gtk_paradise/widgets/gtk3/editor/internal_widgets/goto_line_widget.rb +52 -65
- data/lib/gtk_paradise/widgets/gtk3/editor/misc.rb +358 -111
- data/lib/gtk_paradise/widgets/gtk3/files_in_directory/files_in_directory.rb +2 -7
- data/lib/gtk_paradise/widgets/gtk3/flexible_vte/flexible_vte.rb +3 -7
- data/lib/gtk_paradise/widgets/gtk3/font_size_widget/action_button.rb +1 -5
- data/lib/gtk_paradise/widgets/gtk3/font_size_widget/font_size_widget.rb +2 -6
- data/lib/gtk_paradise/widgets/{gtk2 → gtk3}/gidnight_commander/gidnight_commander.config +1 -2
- data/lib/gtk_paradise/widgets/gtk3/gidnight_commander/gidnight_commander.rb +165 -125
- data/lib/gtk_paradise/widgets/gtk3/image_close_on_click_action/image_close_on_click_action.rb +34 -2
- data/lib/gtk_paradise/widgets/gtk3/image_viewer/image_viewer.rb +23 -26
- data/lib/gtk_paradise/widgets/gtk3/information_about_the_harddisc/harddisc_information.rb +161 -0
- data/lib/gtk_paradise/widgets/gtk3/insert_character/insert_character.rb +24 -29
- data/lib/gtk_paradise/widgets/gtk3/linux_users/linux_users.rb +32 -32
- data/lib/gtk_paradise/widgets/gtk3/my_calendar/my_calendar.rb +330 -7
- data/lib/gtk_paradise/widgets/gtk3/my_image_menu_item/my_image_menu_item.rb +179 -0
- data/lib/gtk_paradise/widgets/gtk3/non_numbers_only/non_numbers_only.rb +136 -0
- data/lib/gtk_paradise/widgets/gtk3/note_window/note_window.rb +199 -0
- data/lib/gtk_paradise/widgets/gtk3/notebook_controller/notebook_controller.rb +311 -7
- data/lib/gtk_paradise/widgets/gtk3/notebook_tab_with_icon/notebook_tab_with_icon.rb +402 -7
- data/lib/gtk_paradise/widgets/gtk3/numbered_lines/numbered_lines.rb +128 -82
- data/lib/gtk_paradise/widgets/{version_agnostic → gtk3/numbers_only}/numbers_only.rb +15 -3
- data/lib/gtk_paradise/widgets/gtk3/ping_widget/ping_widget.rb +491 -8
- data/lib/gtk_paradise/widgets/gtk3/regex_matcher/regex_matcher.rb +362 -43
- data/lib/gtk_paradise/widgets/gtk3/rename_widget/rename_widget.rb +8 -25
- data/lib/gtk_paradise/widgets/gtk3/show_which_key_was_pressed/show_which_key_was_pressed.rb +190 -0
- data/lib/gtk_paradise/widgets/gtk3/stopwatch/stopwatch.rb +318 -7
- data/lib/gtk_paradise/widgets/gtk3/sys_message/sys_message.rb +219 -7
- data/lib/gtk_paradise/widgets/gtk3/system_information/system_information.rb +58 -34
- data/lib/gtk_paradise/widgets/gtk3/tabble/admin_panel.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk3/tabble/image_and_button.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk3/tabble/tabble.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk3/view_webpage/view_webpage.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk3/wiki/README.md +4 -0
- data/lib/gtk_paradise/widgets/gtk3/wiki/wiki.rb +388 -0
- data/lib/gtk_paradise/widgets/gtk4/ping_widget/ping_widget.rb +4 -0
- data/lib/gtk_paradise/widgets/gtk4/show_icon_theme/show_icon_theme.rb +134 -0
- data/lib/gtk_paradise/widgets/gtk4/sys_message/sys_message.rb +269 -0
- data/lib/gtk_paradise/widgets/{gtk2/stopwatch/stopwatch.rb → gtk4/xpm_loader/xpm_loader.rb} +13 -11
- data/lib/gtk_paradise/widgets/shared_code/browser/browser_module.rb +4 -16
- data/lib/gtk_paradise/widgets/shared_code/cdripper/cdripper_module.rb +1 -1
- data/lib/gtk_paradise/widgets/shared_code/colour_filled_widget/colour_filled_widget_module.rb +25 -28
- data/lib/gtk_paradise/widgets/shared_code/colour_palette/colour_palette_module.rb +2 -2
- data/lib/gtk_paradise/widgets/shared_code/contacts/contacts_module.rb +62 -64
- data/lib/gtk_paradise/widgets/shared_code/flip_state_widget/flip_state_widget_module.rb +3 -19
- data/lib/gtk_paradise/widgets/shared_code/information_about_the_harddisc/harddisc_information.rb +0 -155
- data/lib/gtk_paradise/widgets/shared_code/information_about_the_harddisc/information_about_the_harddisc_module.rb +0 -444
- data/lib/gtk_paradise/widgets/shared_code/lsmod/lsmod_module.rb +22 -26
- data/lib/gtk_paradise/widgets/shared_code/lspci/lspci_module.rb +24 -36
- data/lib/gtk_paradise/widgets/shared_code/mini_clock/mini_clock_module.rb +74 -58
- data/lib/gtk_paradise/widgets/shared_code/my_calendar/my_calendar_module.rb +0 -327
- data/lib/gtk_paradise/widgets/shared_code/pid_displayer/pid_displayer_module.rb +53 -41
- data/lib/gtk_paradise/widgets/shared_code/random_image/random_image_module.rb +46 -29
- data/lib/gtk_paradise/widgets/shared_code/select_file/select_file_module.rb +1 -1
- data/lib/gtk_paradise/widgets/shared_code/show_icon_theme/show_icon_theme_module.rb +56 -44
- data/lib/gtk_paradise/widgets/shared_code/simple_clock/simple_clock_module.rb +1 -12
- data/lib/gtk_paradise/widgets/shared_code/stopwatch/stopwatch_module.rb +0 -341
- data/lib/gtk_paradise/widgets/shared_code/sys_message/sys_message_module.rb +0 -211
- data/lib/gtk_paradise/widgets/shared_code/tabby/tabby_module.rb +3 -15
- data/lib/gtk_paradise/widgets/shared_code/xpm_loader/xpm_loader_module.rb +15 -23
- data/lib/gtk_paradise/www/index.cgi +2 -2
- data/lib/gtk_paradise/yaml/browser_URLs.yml +3 -4
- data/lib/gtk_paradise/yaml/configuration_options_for_class_gtk_runner.yml +6 -6
- data/lib/gtk_paradise/yaml/experimental/README.md +3 -0
- data/lib/gtk_paradise/yaml/experimental/all_widgets.yml +37 -0
- data/lib/gtk_paradise/yaml/menu.yml +6 -3
- data/lib/gtk_paradise/yaml/notebook_controller.yml +62 -29
- data/lib/gtk_paradise.rb +0 -5
- data/test/gtk2/testing_combo_box.rb +1 -0
- data/test/gtk2/testing_display.rb +23 -0
- data/test/gtk2/testing_gtk_image.rb +4 -3
- data/test/gtk2/testing_hbox_and_vbox.rb +37 -0
- data/test/gtk2/testing_label_with_ampersand.rb +5 -2
- data/test/gtk2/testing_notebook.rb +11 -5
- data/test/gtk3/test_widget.rb +2 -1
- data/test/gtk3/testing_app.rb +0 -1
- data/test/gtk3/testing_base_module.rb +2 -1
- data/test/gtk3/testing_numbered_lines.rb +20 -0
- data/test/gtk3/testing_project_base_directory.rb +6 -1
- data/test/gtk3/testing_the_html_pseudo_tags.rb +2 -2
- data/test/gtk4/testing_gtk_entry.rb +24 -0
- data/test/misc/testing_a_gtk_frame.rb +14 -0
- data/test/misc/testing_gtk4_simplifications.rb +105 -0
- data/test/misc/testing_gtk_paradise_runner.rb +19 -4
- data/test/misc/testing_the_gtk_classes.rb +83 -0
- metadata +246 -199
- data/lib/gtk_paradise/base_module/change_directory.rb +0 -22
- data/lib/gtk_paradise/base_module/combo_box_and_combo_box_entry.rb +0 -113
- data/lib/gtk_paradise/base_module/commandline_arguments.rb +0 -36
- data/lib/gtk_paradise/base_module/configuration.rb +0 -50
- data/lib/gtk_paradise/base_module/constants.rb +0 -23
- data/lib/gtk_paradise/base_module/debug.rb +0 -127
- data/lib/gtk_paradise/base_module/draggable.rb +0 -95
- data/lib/gtk_paradise/base_module/emoji.rb +0 -107
- data/lib/gtk_paradise/base_module/esystem.rb +0 -22
- data/lib/gtk_paradise/base_module/events.rb +0 -111
- data/lib/gtk_paradise/base_module/fonts.rb +0 -119
- data/lib/gtk_paradise/base_module/graphics_display.rb +0 -47
- data/lib/gtk_paradise/base_module/gtk3.rb +0 -43
- data/lib/gtk_paradise/base_module/gtk_buttons.rb +0 -562
- data/lib/gtk_paradise/base_module/gtk_entry.rb +0 -126
- data/lib/gtk_paradise/base_module/gtk_fixed.rb +0 -18
- data/lib/gtk_paradise/base_module/gtk_grid.rb +0 -61
- data/lib/gtk_paradise/base_module/gtk_image.rb +0 -501
- data/lib/gtk_paradise/base_module/gtk_label.rb +0 -211
- data/lib/gtk_paradise/base_module/gtk_notebook.rb +0 -88
- data/lib/gtk_paradise/base_module/gtk_scrolled_window.rb +0 -155
- data/lib/gtk_paradise/base_module/misc.rb +0 -2949
- data/lib/gtk_paradise/base_module/pango.rb +0 -24
- data/lib/gtk_paradise/base_module/popover.rb +0 -241
- data/lib/gtk_paradise/base_module/register_sigint.rb +0 -20
- data/lib/gtk_paradise/base_module/reset.rb +0 -128
- data/lib/gtk_paradise/base_module/return_corresponding_gtk_stock_item.rb +0 -92
- data/lib/gtk_paradise/base_module/roebe.rb +0 -19
- data/lib/gtk_paradise/base_module/table.rb +0 -438
- data/lib/gtk_paradise/base_module/time.rb +0 -35
- data/lib/gtk_paradise/constants/available_cursors.rb +0 -52
- data/lib/gtk_paradise/constants/fonts.rb +0 -38
- data/lib/gtk_paradise/constants/misc.rb +0 -56
- data/lib/gtk_paradise/constants/newline.rb +0 -14
- data/lib/gtk_paradise/constants/xbm_icons.rb +0 -121
- data/lib/gtk_paradise/examples/gtk3/003_sorted_tree.rb +0 -141
- data/lib/gtk_paradise/examples/gtk3/034_combo_box_example.rb +0 -49
- data/lib/gtk_paradise/examples/gtk3/068_text_view_example.rb +0 -34
- data/lib/gtk_paradise/examples/gtk3/071_search_bar_example.rb +0 -59
- data/lib/gtk_paradise/gtk_classes/colours/colours.rb +0 -158
- data/lib/gtk_paradise/requires/require_the_minesweeper_files.rb +0 -11
- data/lib/gtk_paradise/toplevel_methods/allow_only_numbers.rb +0 -59
- data/lib/gtk_paradise/toplevel_methods/csv.rb +0 -102
- data/lib/gtk_paradise/toplevel_methods/e.rb +0 -18
- data/lib/gtk_paradise/toplevel_methods/enable_and_disable_warnings.rb +0 -58
- data/lib/gtk_paradise/toplevel_methods/keyboard.rb +0 -25
- data/lib/gtk_paradise/toplevel_methods/main_file.rb +0 -31
- data/lib/gtk_paradise/toplevel_methods/register_sigint.rb +0 -17
- data/lib/gtk_paradise/toplevel_methods/roebe.rb +0 -22
- data/lib/gtk_paradise/toplevel_methods/select_file.rb +0 -168
- data/lib/gtk_paradise/toplevel_methods/spacer.rb +0 -55
- data/lib/gtk_paradise/toplevel_methods/tooltips.rb +0 -71
- data/lib/gtk_paradise/toplevel_methods/we_use_this_gtk_version.rb +0 -65
- data/lib/gtk_paradise/widgets/gtk2/directory_content_widget/directory_content_widget.rb +0 -30
- data/lib/gtk_paradise/widgets/gtk2/my_calendar/my_calendar.config +0 -6
- data/lib/gtk_paradise/widgets/gtk2/my_calendar/my_calendar.rb +0 -34
- data/lib/gtk_paradise/widgets/gtk2/notebook_tab_with_icon/notebook_tab_with_icon.rb +0 -30
- data/lib/gtk_paradise/widgets/gtk2/ping_widget/ping_widget.rb +0 -30
- data/lib/gtk_paradise/widgets/gtk2/sys_message/sys_message.config +0 -6
- data/lib/gtk_paradise/widgets/gtk2/sys_message/sys_message.rb +0 -29
- data/lib/gtk_paradise/widgets/shared_code/directory_content_widget/constants.rb +0 -53
- data/lib/gtk_paradise/widgets/shared_code/directory_content_widget/directory_content_widget_module.rb +0 -777
- data/lib/gtk_paradise/widgets/shared_code/directory_content_widget/handle_this_file_or_symlink.rb +0 -83
- data/lib/gtk_paradise/widgets/shared_code/notebook_controller/notebook_controller_module.rb +0 -339
- data/lib/gtk_paradise/widgets/shared_code/notebook_tab_with_icon/notebook_tab_with_icon_module.rb +0 -297
- data/lib/gtk_paradise/widgets/shared_code/ping_widget/ping_widget_module.rb +0 -326
- data/lib/gtk_paradise/widgets/version_agnostic/button_with_border.rb +0 -63
- data/lib/gtk_paradise/widgets/version_agnostic/coloured_unit.rb +0 -54
- data/lib/gtk_paradise/widgets/version_agnostic/my_image_menu_item.rb +0 -103
- data/lib/gtk_paradise/widgets/version_agnostic/my_menu_item_separator.rb +0 -31
- data/lib/gtk_paradise/widgets/version_agnostic/non_numbers_only.rb +0 -66
- data/lib/gtk_paradise/widgets/version_agnostic/note_window.rb +0 -107
- /data/lib/gtk_paradise/examples/gtk3/{084_undecorated_window_example.rb → 014_undecorated_window_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{077_status_icon_example.rb → 019_status_icon_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{076_stack_example.rb → 020_stack_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{006_password_example.rb → 025_password_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{015_list_box_example.rb → 033_list_box_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{020_radio_button_window.rb → 038_radio_button_window.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{021_scale_button_demo.rb → 039_scale_button_demo.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{024_installation_assistant.rb → 042_installation_assistant.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{035_notebook_css_example.rb → 052_notebook_css_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{040_font_chooser_dialog_example.rb → 056_font_chooser_dialog_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{041_flowbox.rb → 057_flowbox.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{045_fixed_example.rb → 061_fixed_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{054_svg_viewer.rb → 070_svg_viewer.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{065_tooltips_example.rb → 079_tooltips_example.rb} +0 -0
@@ -16,11 +16,6 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
16
16
|
require 'gtk_paradise/requires/require_the_base_module.rb'
|
17
17
|
include ::Gtk::BaseModule
|
18
18
|
|
19
|
-
# ========================================================================= #
|
20
|
-
# === NAMESPACE
|
21
|
-
# ========================================================================= #
|
22
|
-
NAMESPACE = inspect
|
23
|
-
|
24
19
|
# ========================================================================= #
|
25
20
|
# === TITLE
|
26
21
|
# ========================================================================= #
|
@@ -34,7 +29,7 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
34
29
|
# ========================================================================= #
|
35
30
|
# === HEIGHT
|
36
31
|
# ========================================================================= #
|
37
|
-
HEIGHT = '
|
32
|
+
HEIGHT = '18% or minimum 180px'
|
38
33
|
|
39
34
|
# ========================================================================= #
|
40
35
|
# === USE_THIS_FONT
|
@@ -45,32 +40,38 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
45
40
|
# === HASH_DESIGNATED_KEY_COMBINATIONS
|
46
41
|
# ========================================================================= #
|
47
42
|
HASH_DESIGNATED_KEY_COMBINATIONS = {
|
48
|
-
'
|
49
|
-
'alt+
|
50
|
-
'alt+
|
51
|
-
'alt+
|
52
|
-
'alt+
|
53
|
-
'alt+
|
54
|
-
'alt+
|
55
|
-
'alt+
|
56
|
-
'alt+
|
57
|
-
'alt+
|
58
|
-
'
|
59
|
-
'
|
60
|
-
'
|
61
|
-
'
|
62
|
-
'
|
63
|
-
'
|
64
|
-
'
|
65
|
-
'
|
66
|
-
'
|
67
|
-
'
|
68
|
-
'
|
69
|
-
'alt
|
70
|
-
'alt
|
71
|
-
'alt
|
43
|
+
'ctrl+=': "input_is('=')", # This one currently does not work.
|
44
|
+
'alt+1': 'input_is(1)',
|
45
|
+
'alt+2': 'input_is(2)',
|
46
|
+
'alt+3': 'input_is(3)',
|
47
|
+
'alt+4': 'input_is(4)',
|
48
|
+
'alt+5': 'input_is(5)',
|
49
|
+
'alt+6': 'input_is(6)',
|
50
|
+
'alt+7': 'input_is(7)',
|
51
|
+
'alt+8': 'input_is(8)',
|
52
|
+
'alt+9': 'input_is(9)',
|
53
|
+
'alt+0': 'input_is(0)',
|
54
|
+
'1': 'input_is(1)',
|
55
|
+
'2': 'input_is(2)',
|
56
|
+
'3': 'input_is(3)',
|
57
|
+
'4': 'input_is(4)',
|
58
|
+
'5': 'input_is(5)',
|
59
|
+
'6': 'input_is(6)',
|
60
|
+
'7': 'input_is(7)',
|
61
|
+
'8': 'input_is(8)',
|
62
|
+
'9': 'input_is(9)',
|
63
|
+
'0': 'input_is(0)',
|
64
|
+
'alt++': "input_is('+')",
|
65
|
+
'alt+-': "input_is('-')",
|
66
|
+
'alt+/': "input_is('/')",
|
67
|
+
'alt+*': "input_is('/*')"
|
72
68
|
}
|
73
69
|
|
70
|
+
# ========================================================================= #
|
71
|
+
# === PERCENTAGE_SIGN
|
72
|
+
# ========================================================================= #
|
73
|
+
PERCENTAGE_SIGN = '%'
|
74
|
+
|
74
75
|
# ========================================================================= #
|
75
76
|
# === initialize
|
76
77
|
# ========================================================================= #
|
@@ -93,23 +94,12 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
93
94
|
# ========================================================================= #
|
94
95
|
def reset
|
95
96
|
reset_the_internal_variables
|
97
|
+
infer_the_namespace
|
96
98
|
# ======================================================================= #
|
97
99
|
# === @configuration
|
98
100
|
# ======================================================================= #
|
99
|
-
@configuration = [true, __dir__,
|
100
|
-
|
101
|
-
# === @title
|
102
|
-
# ======================================================================= #
|
103
|
-
set_title(TITLE)
|
104
|
-
# ======================================================================= #
|
105
|
-
# === @width
|
106
|
-
# ======================================================================= #
|
107
|
-
set_width(WIDTH)
|
108
|
-
# ======================================================================= #
|
109
|
-
# === @height
|
110
|
-
# ======================================================================= #
|
111
|
-
set_height(HEIGHT)
|
112
|
-
set_use_this_font(USE_THIS_FONT)
|
101
|
+
@configuration = [true, __dir__, namespace?]
|
102
|
+
title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
|
113
103
|
handle_CSS_rules
|
114
104
|
infer_the_size_automatically
|
115
105
|
end
|
@@ -164,6 +154,7 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
164
154
|
_ = Gdk::Keyval.to_name(event.keyval)
|
165
155
|
case _
|
166
156
|
when '*',
|
157
|
+
'x',
|
167
158
|
'/',
|
168
159
|
'-',
|
169
160
|
'+',
|
@@ -187,31 +178,31 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
187
178
|
@grid = gtk_grid
|
188
179
|
@box.maximal(@grid, 10)
|
189
180
|
# ======================================================================= #
|
190
|
-
# All the buttons and the function that will be fired
|
191
|
-
#
|
181
|
+
# All the buttons and the function that will be fired when they
|
182
|
+
# are clicked.
|
192
183
|
# ======================================================================= #
|
193
|
-
button1 =
|
184
|
+
button1 = button('1')
|
194
185
|
button1.width_height(80,80)
|
195
186
|
button1.on_clicked {
|
196
187
|
input_is(1)
|
197
188
|
}
|
198
189
|
@grid.add(button1)
|
199
190
|
|
200
|
-
button2 =
|
191
|
+
button2 = button('2')
|
201
192
|
button2.width_height(80,80)
|
202
193
|
button2.on_clicked {
|
203
194
|
input_is(2)
|
204
195
|
}
|
205
196
|
@grid.attach_next_to(button2, button1, 1, 1, 1)
|
206
197
|
|
207
|
-
button3 =
|
198
|
+
button3 = button('3')
|
208
199
|
button3.width_height(80,80)
|
209
200
|
button3.on_clicked {
|
210
201
|
input_is(3)
|
211
202
|
}
|
212
203
|
@grid.attach_next_to(button3, button2, 1, 1, 1)
|
213
204
|
|
214
|
-
button_plus =
|
205
|
+
button_plus = button('+')
|
215
206
|
button_plus.width_height(80,80)
|
216
207
|
button_plus.on_clicked {
|
217
208
|
unless last_char? == button_plus.text?
|
@@ -220,7 +211,7 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
220
211
|
}
|
221
212
|
@grid.attach_next_to(button_plus, button3, 1, 1, 1)
|
222
213
|
|
223
|
-
button_square =
|
214
|
+
button_square = button('sqrt')
|
224
215
|
button_square.hint = 'This will square the input, e. g. 2 ** 2 aka 2².'
|
225
216
|
button_square.width_height(80,80)
|
226
217
|
button_square.on_clicked {
|
@@ -228,28 +219,28 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
228
219
|
}
|
229
220
|
@grid.attach_next_to(button_square, button_plus, 1, 1, 1)
|
230
221
|
|
231
|
-
button4 =
|
222
|
+
button4 = button('4')
|
232
223
|
button4.width_height(80,80)
|
233
224
|
button4.on_clicked {
|
234
225
|
input_is(4)
|
235
226
|
}
|
236
227
|
@grid.attach_next_to(button4, button1, 3, 1, 1)
|
237
228
|
|
238
|
-
button5 =
|
229
|
+
button5 = button('5')
|
239
230
|
button5.width_height(80,80)
|
240
231
|
button5.on_clicked {
|
241
232
|
input_is(5)
|
242
233
|
}
|
243
234
|
@grid.attach_next_to(button5, button4, 1, 1, 1)
|
244
235
|
|
245
|
-
button6 =
|
236
|
+
button6 = button('6')
|
246
237
|
button6.width_height(80,80)
|
247
238
|
button6.on_clicked {
|
248
239
|
input_is(6)
|
249
240
|
}
|
250
241
|
@grid.attach_next_to(button6, button5, 1, 1, 1)
|
251
242
|
|
252
|
-
button_minus =
|
243
|
+
button_minus = button('-')
|
253
244
|
button_minus.width_height(80,80)
|
254
245
|
button_minus.on_clicked {
|
255
246
|
unless last_char? == button_minus.text?
|
@@ -258,28 +249,38 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
258
249
|
}
|
259
250
|
@grid.attach_next_to(button_minus, button6, 1, 1, 1)
|
260
251
|
|
261
|
-
|
252
|
+
# ======================================================================= #
|
253
|
+
# === %
|
254
|
+
# ======================================================================= #
|
255
|
+
button_percentage_sign = button(PERCENTAGE_SIGN)
|
256
|
+
button_percentage_sign.width_height(80,80)
|
257
|
+
button_percentage_sign.on_clicked {
|
258
|
+
input_is(button_percentage_sign.text?)
|
259
|
+
}
|
260
|
+
@grid.attach_next_to(button_percentage_sign, button_minus, 1, 1, 1)
|
261
|
+
|
262
|
+
button7 = button('7')
|
262
263
|
button7.width_height(80,80)
|
263
264
|
button7.on_clicked {
|
264
265
|
input_is(7)
|
265
266
|
}
|
266
267
|
@grid.attach_next_to(button7, button4, 3, 1, 1)
|
267
268
|
|
268
|
-
button8 =
|
269
|
+
button8 = button('8')
|
269
270
|
button8.width_height(80,80)
|
270
271
|
button8.on_clicked {
|
271
272
|
input_is(8)
|
272
273
|
}
|
273
274
|
@grid.attach_next_to(button8, button7, 1, 1, 1)
|
274
275
|
|
275
|
-
button9 =
|
276
|
+
button9 = button('9')
|
276
277
|
button9.width_height(80,80)
|
277
278
|
button9.on_clicked {
|
278
279
|
input_is(9)
|
279
280
|
}
|
280
281
|
@grid.attach_next_to(button9, button8, 1, 1, 1)
|
281
282
|
|
282
|
-
button_multiply =
|
283
|
+
button_multiply = button('*')
|
283
284
|
button_multiply.width_height(80,80)
|
284
285
|
button_multiply.on_clicked {
|
285
286
|
unless last_char? == '*'
|
@@ -288,7 +289,7 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
288
289
|
}
|
289
290
|
@grid.attach_next_to(button_multiply, button9, 1, 1, 1)
|
290
291
|
|
291
|
-
button0 =
|
292
|
+
button0 = button('0')
|
292
293
|
button0.width_height(80,80)
|
293
294
|
button0.on_clicked {
|
294
295
|
input_is(0)
|
@@ -298,7 +299,7 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
298
299
|
# ======================================================================= #
|
299
300
|
# === button_clear
|
300
301
|
# ======================================================================= #
|
301
|
-
button_clear =
|
302
|
+
button_clear = button('_clear')
|
302
303
|
button_clear.width_height(80,80)
|
303
304
|
button_clear.on_clicked {
|
304
305
|
do_clear_the_main_label
|
@@ -306,17 +307,20 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
306
307
|
button_clear.hint = 'This button will clear the display.'
|
307
308
|
@grid.attach_next_to(button_clear, button0, 1, 1, 1)
|
308
309
|
|
309
|
-
button_equal =
|
310
|
+
button_equal = button('=')
|
310
311
|
button_equal.width_height(80,80)
|
311
312
|
button_equal.on_clicked {
|
312
313
|
do_evaluate_the_current_text
|
313
314
|
}
|
314
315
|
@grid.attach_next_to(button_equal, button_clear, 1, 1, 1)
|
315
316
|
|
316
|
-
button_divide =
|
317
|
+
button_divide = button('/')
|
317
318
|
button_divide.width_height(80,80)
|
319
|
+
button_divide.hint = return_hint_for_the_division_button
|
318
320
|
button_divide.on_clicked {
|
321
|
+
# ===================================================================== #
|
319
322
|
# We will only allow one '/' to be appended.
|
323
|
+
# ===================================================================== #
|
320
324
|
unless last_char? == '/'
|
321
325
|
@label_results.append(button_divide.text?)
|
322
326
|
end
|
@@ -349,7 +353,8 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
349
353
|
# ========================================================================= #
|
350
354
|
def main_text?
|
351
355
|
@label_results.text?
|
352
|
-
end; alias string?
|
356
|
+
end; alias string? main_text? # === string?
|
357
|
+
alias main_entry_text? main_text? # === main_entry_text?
|
353
358
|
|
354
359
|
# ========================================================================= #
|
355
360
|
# === do_square_the_result
|
@@ -357,12 +362,16 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
357
362
|
def do_square_the_result(
|
358
363
|
i = main_text?
|
359
364
|
)
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
365
|
+
begin
|
366
|
+
result = eval(i)
|
367
|
+
if result.nil?
|
368
|
+
e 'Got a nil-result. Input was: '+i.to_s
|
369
|
+
else
|
370
|
+
result = Math.sqrt(result)
|
371
|
+
set_main_text(result.to_s)
|
372
|
+
end
|
373
|
+
rescue Exception => error
|
374
|
+
pp error
|
366
375
|
end
|
367
376
|
end
|
368
377
|
|
@@ -401,31 +410,129 @@ class Calculator < ::Gtk::Frame # === Gtk::Calculator
|
|
401
410
|
# ========================================================================= #
|
402
411
|
def set_main_text(i)
|
403
412
|
@label_results.set_text(i.to_s)
|
404
|
-
end; alias string=
|
405
|
-
alias update_entry
|
413
|
+
end; alias string= set_main_text # === string=
|
414
|
+
alias update_entry set_main_text # === update_entry
|
415
|
+
alias set_this_as_the_new_result set_main_text # === set_this_as_the_new_result
|
406
416
|
|
407
417
|
# ========================================================================= #
|
408
|
-
# === input_is
|
418
|
+
# === input_is (input tag)
|
409
419
|
# ========================================================================= #
|
410
420
|
def input_is(i = 1)
|
421
|
+
# ======================================================================= #
|
422
|
+
# Next sanitize the names "plus", "minus", "asterisk", and "slash".
|
423
|
+
# ======================================================================= #
|
411
424
|
case i
|
425
|
+
# ======================================================================= #
|
426
|
+
# === plus
|
427
|
+
# ======================================================================= #
|
412
428
|
when 'plus'
|
413
429
|
i = '+'
|
430
|
+
# ======================================================================= #
|
431
|
+
# === minus
|
432
|
+
# ======================================================================= #
|
414
433
|
when 'minus'
|
415
434
|
i = '-'
|
416
|
-
|
435
|
+
# ======================================================================= #
|
436
|
+
# === asterisk
|
437
|
+
# ======================================================================= #
|
438
|
+
when 'asterisk','x'
|
417
439
|
i = '*'
|
440
|
+
# ======================================================================= #
|
441
|
+
# === slash
|
442
|
+
# ======================================================================= #
|
418
443
|
when 'slash'
|
419
444
|
i = '/'
|
420
445
|
end
|
421
|
-
|
446
|
+
case i
|
447
|
+
when PERCENTAGE_SIGN
|
448
|
+
do_perform_percentage_evaluation(main_entry_text?)
|
449
|
+
else
|
450
|
+
@label_results.append(i.to_s)
|
451
|
+
end
|
452
|
+
# main_entry?.cursor_is_on_the_right
|
453
|
+
end
|
454
|
+
|
455
|
+
# ========================================================================= #
|
456
|
+
# === main_entry?
|
457
|
+
# ========================================================================= #
|
458
|
+
def main_entry?
|
459
|
+
@label_results
|
460
|
+
end
|
461
|
+
|
462
|
+
# ========================================================================= #
|
463
|
+
# === return_hint_for_the_division_button
|
464
|
+
# ========================================================================= #
|
465
|
+
def return_hint_for_the_division_button
|
466
|
+
"This button can be used to <b>divide</b> two values, such as 6 / 3.\n\n"\
|
467
|
+
"In Unicode this would be the following token: ÷"
|
468
|
+
end
|
469
|
+
|
470
|
+
# ========================================================================= #
|
471
|
+
# === do_perform_percentage_evaluation
|
472
|
+
# ========================================================================= #
|
473
|
+
def do_perform_percentage_evaluation(
|
474
|
+
i = main_entry_text?
|
475
|
+
)
|
476
|
+
use_this_as_the_split_token = i.gsub(/\d/,'')
|
477
|
+
if i.include?(use_this_as_the_split_token)
|
478
|
+
# ===================================================================== #
|
479
|
+
# For instance, "600*15", which should be 90, as 90 is 15% of 600.
|
480
|
+
# ===================================================================== #
|
481
|
+
splitted = i.split(use_this_as_the_split_token)
|
482
|
+
a = splitted.first.to_f
|
483
|
+
percentage_value = splitted.last.to_f
|
484
|
+
case use_this_as_the_split_token
|
485
|
+
# ===================================================================== #
|
486
|
+
# === *
|
487
|
+
# ===================================================================== #
|
488
|
+
when '*'
|
489
|
+
result = (
|
490
|
+
a * percentage_value / 100.0
|
491
|
+
)
|
492
|
+
# ===================================================================== #
|
493
|
+
# === /
|
494
|
+
# ===================================================================== #
|
495
|
+
when '/'
|
496
|
+
result = (
|
497
|
+
a / (percentage_value / 100.0)
|
498
|
+
)
|
499
|
+
# ===================================================================== #
|
500
|
+
# === +
|
501
|
+
# ===================================================================== #
|
502
|
+
when '+' # This is "34+7" which means to calculate at 107.0
|
503
|
+
result = (
|
504
|
+
a * ( (100+percentage_value) / 100.0)
|
505
|
+
)
|
506
|
+
# ===================================================================== #
|
507
|
+
# === -
|
508
|
+
# ===================================================================== #
|
509
|
+
when '-' # This is "79-30" which means the result will be 55.3
|
510
|
+
result = (
|
511
|
+
a * ( (100-percentage_value) / 100.0)
|
512
|
+
)
|
513
|
+
end
|
514
|
+
set_this_as_the_new_result(result)
|
515
|
+
else
|
516
|
+
e 'Can not evaluate the following input: '+tomato(i)
|
517
|
+
end
|
422
518
|
end
|
423
519
|
|
424
520
|
# ========================================================================= #
|
425
521
|
# === run (run tag)
|
426
522
|
# ========================================================================= #
|
427
523
|
def run
|
428
|
-
|
524
|
+
super()
|
525
|
+
do_style_all_buttons_in_a_uniform_manner
|
526
|
+
end
|
527
|
+
|
528
|
+
# ========================================================================= #
|
529
|
+
# === do_style_all_buttons_in_a_uniform_manner
|
530
|
+
# ========================================================================= #
|
531
|
+
def do_style_all_buttons_in_a_uniform_manner
|
532
|
+
return_all_buttons?.each {|this_button|
|
533
|
+
this_button.remove_background
|
534
|
+
this_button.on_hover(:lightgreen)
|
535
|
+
}
|
429
536
|
end
|
430
537
|
|
431
538
|
# ========================================================================= #
|
@@ -16,11 +16,6 @@ class CheckboxImage < ::Gtk::Box # === Gtk::CheckboxImage
|
|
16
16
|
require 'gtk_paradise/requires/require_the_base_module.rb'
|
17
17
|
include ::Gtk::BaseModule
|
18
18
|
|
19
|
-
# ========================================================================= #
|
20
|
-
# === NAMESPACE
|
21
|
-
# ========================================================================= #
|
22
|
-
NAMESPACE = inspect
|
23
|
-
|
24
19
|
# ========================================================================= #
|
25
20
|
# === TITLE
|
26
21
|
# ========================================================================= #
|
@@ -61,10 +56,11 @@ class CheckboxImage < ::Gtk::Box # === Gtk::CheckboxImage
|
|
61
56
|
# ========================================================================= #
|
62
57
|
def reset
|
63
58
|
reset_the_internal_variables
|
59
|
+
infer_the_namespace
|
64
60
|
# ======================================================================= #
|
65
61
|
# === @configuration
|
66
62
|
# ======================================================================= #
|
67
|
-
@configuration = [true, __dir__,
|
63
|
+
@configuration = [true, __dir__, namespace?]
|
68
64
|
# ======================================================================= #
|
69
65
|
# === @title
|
70
66
|
# ======================================================================= #
|
@@ -78,7 +74,7 @@ class CheckboxImage < ::Gtk::Box # === Gtk::CheckboxImage
|
|
78
74
|
# ======================================================================= #
|
79
75
|
set_height(HEIGHT)
|
80
76
|
set_use_this_font(USE_THIS_FONT)
|
81
|
-
use_gtk_paradise_project_css_file
|
77
|
+
use_gtk_paradise_project_css_file
|
82
78
|
infer_the_size_automatically
|
83
79
|
end
|
84
80
|
|
@@ -11,22 +11,37 @@
|
|
11
11
|
# Gtk::ColouredButton.new('_NIHSearch_darkslategray', true)
|
12
12
|
#
|
13
13
|
# =========================================================================== #
|
14
|
-
# require 'gtk_paradise/
|
14
|
+
# require 'gtk_paradise/gui/gtk3/coloured_button/coloured_button.rb'
|
15
15
|
# Gtk::ColouredButton.new('Test_cyan')
|
16
16
|
# =========================================================================== #
|
17
|
+
require 'gtk_paradise/require_gtk3'
|
18
|
+
|
17
19
|
module Gtk
|
18
20
|
|
19
|
-
class ColouredButton < ::Gtk::Button # === Gtk::ColouredButton
|
21
|
+
class ColouredButton < ::Gtk::Button # === Gtk::ColouredButton
|
20
22
|
|
21
|
-
require 'gtk_paradise/
|
23
|
+
require 'gtk_paradise/requires/require_the_base_module.rb'
|
24
|
+
include ::Gtk::BaseModule
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
# ========================================================================= #
|
27
|
+
# === TITLE
|
28
|
+
# ========================================================================= #
|
29
|
+
TITLE = 'Coloured button'
|
30
|
+
|
31
|
+
# ========================================================================= #
|
32
|
+
# === WIDTH
|
33
|
+
# ========================================================================= #
|
34
|
+
WIDTH = '25% or minimum 200px'
|
27
35
|
|
28
|
-
|
29
|
-
|
36
|
+
# ========================================================================= #
|
37
|
+
# === HEIGHT
|
38
|
+
# ========================================================================= #
|
39
|
+
HEIGHT = '15% or minimum 100px'
|
40
|
+
|
41
|
+
# ========================================================================= #
|
42
|
+
# === USE_THIS_FONT
|
43
|
+
# ========================================================================= #
|
44
|
+
USE_THIS_FONT = :dejavu_condensed_20
|
30
45
|
|
31
46
|
attr_accessor :colour_active
|
32
47
|
attr_accessor :colour_normal
|
@@ -75,6 +90,7 @@ class ColouredButton < ::Gtk::Button # === Gtk::ColouredButton
|
|
75
90
|
colourize = true,
|
76
91
|
optional_array_with_icons = nil
|
77
92
|
)
|
93
|
+
super()
|
78
94
|
reset
|
79
95
|
case is_a_quit_button
|
80
96
|
when :this_is_a_quit_button,
|
@@ -116,9 +132,56 @@ class ColouredButton < ::Gtk::Button # === Gtk::ColouredButton
|
|
116
132
|
# === reset (reset tag)
|
117
133
|
# ========================================================================= #
|
118
134
|
def reset
|
135
|
+
reset_the_internal_variables
|
136
|
+
infer_the_namespace
|
137
|
+
# ======================================================================= #
|
138
|
+
# === @configuration
|
139
|
+
# ======================================================================= #
|
140
|
+
@configuration = [true, __dir__, namespace?]
|
141
|
+
# ======================================================================= #
|
142
|
+
# === Set the title, width, height and the font in use.
|
143
|
+
# ======================================================================= #
|
144
|
+
title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
|
145
|
+
use_gtk_paradise_project_css_file
|
146
|
+
infer_the_size_automatically
|
119
147
|
@can_be_clicked = true # on default, every button can be clicked
|
120
148
|
end
|
121
149
|
|
150
|
+
# ========================================================================= #
|
151
|
+
# === padding?
|
152
|
+
# ========================================================================= #
|
153
|
+
def padding?
|
154
|
+
4
|
155
|
+
end
|
156
|
+
|
157
|
+
# ========================================================================= #
|
158
|
+
# === border_size?
|
159
|
+
# ========================================================================= #
|
160
|
+
def border_size?
|
161
|
+
2
|
162
|
+
end
|
163
|
+
|
164
|
+
# ========================================================================= #
|
165
|
+
# === create_skeleton (create tag, skeleton tag)
|
166
|
+
# ========================================================================= #
|
167
|
+
def create_skeleton
|
168
|
+
end
|
169
|
+
|
170
|
+
# ========================================================================= #
|
171
|
+
# === connect_skeleton (connect tag)
|
172
|
+
# ========================================================================= #
|
173
|
+
def connect_skeleton
|
174
|
+
abort_on_exception
|
175
|
+
minimal(gtk_left_aligned_label('Hello world! This is a simple test.'))
|
176
|
+
end
|
177
|
+
|
178
|
+
# ========================================================================= #
|
179
|
+
# === run (run tag)
|
180
|
+
# ========================================================================= #
|
181
|
+
def run
|
182
|
+
create_skeleton_then_connect_skeleton
|
183
|
+
end
|
184
|
+
|
122
185
|
# ========================================================================= #
|
123
186
|
# === set_new_icon
|
124
187
|
#
|
@@ -127,7 +190,7 @@ class ColouredButton < ::Gtk::Button # === Gtk::ColouredButton
|
|
127
190
|
# ========================================================================= #
|
128
191
|
def set_new_icon(i)
|
129
192
|
if i.is_a? String
|
130
|
-
image =
|
193
|
+
image = gtk_image(location)
|
131
194
|
image.set_padding(4,0) # left-right axis, top-down axis
|
132
195
|
set_image(image)
|
133
196
|
elsif i.is_a? Array
|
@@ -228,21 +291,28 @@ class ColouredButton < ::Gtk::Button # === Gtk::ColouredButton
|
|
228
291
|
@text
|
229
292
|
end; alias text text? # === text
|
230
293
|
|
294
|
+
# ========================================================================= #
|
295
|
+
# === Gtk::ColouredButton.run
|
296
|
+
# ========================================================================= #
|
297
|
+
def self.run(
|
298
|
+
i = ARGV
|
299
|
+
)
|
300
|
+
begin
|
301
|
+
require 'colours'
|
302
|
+
rescue LoadError; end
|
303
|
+
require 'gtk_paradise/app/app.rb'
|
304
|
+
coloured_button = Gtk::ColouredButton.new(
|
305
|
+
"_Test_#{::Colours.random_html_colour}"
|
306
|
+
)
|
307
|
+
coloured_button.toggle_focus
|
308
|
+
r = ::Gtk.run
|
309
|
+
r << coloured_button
|
310
|
+
r.automatic_size_then_automatic_title
|
311
|
+
r.top_left_then_run
|
312
|
+
end
|
313
|
+
|
231
314
|
end; end
|
232
315
|
|
233
316
|
if __FILE__ == $PROGRAM_NAME
|
234
|
-
|
235
|
-
require 'gtk_paradise/require_gtk3.rb'
|
236
|
-
require 'gtk_paradise/run'
|
237
|
-
r = Gtk.run
|
238
|
-
coloured_button = Gtk::ColouredButton.new(
|
239
|
-
"_Test_#{Colours::HtmlColours.random_colour}"
|
240
|
-
)
|
241
|
-
coloured_button.toggle_focus
|
242
|
-
# puts coloured_button.colour_active
|
243
|
-
# puts coloured_button.colour_normal
|
244
|
-
# puts coloured_button.colour_prelight
|
245
|
-
r << coloured_button
|
246
|
-
r.set_default_size(130, 130)
|
247
|
-
r.top_left_then_run
|
317
|
+
Gtk::ColouredButton.run
|
248
318
|
end # gtkcolouredbutton
|
@@ -16,11 +16,6 @@ class ColouredSquare < ::Gtk::Box
|
|
16
16
|
require 'gtk_paradise/requires/require_the_base_module.rb'
|
17
17
|
include ::Gtk::BaseModule
|
18
18
|
|
19
|
-
# ========================================================================= #
|
20
|
-
# === NAMESPACE
|
21
|
-
# ========================================================================= #
|
22
|
-
NAMESPACE = inspect
|
23
|
-
|
24
19
|
# ========================================================================= #
|
25
20
|
# === TITLE
|
26
21
|
# ========================================================================= #
|
@@ -56,10 +51,11 @@ class ColouredSquare < ::Gtk::Box
|
|
56
51
|
# ========================================================================= #
|
57
52
|
def reset
|
58
53
|
reset_the_internal_variables
|
54
|
+
infer_the_namespace
|
59
55
|
# ======================================================================= #
|
60
56
|
# === @configuration
|
61
57
|
# ======================================================================= #
|
62
|
-
@configuration = [true, __dir__,
|
58
|
+
@configuration = [true, __dir__, namespace?]
|
63
59
|
# ======================================================================= #
|
64
60
|
# === @title
|
65
61
|
# ======================================================================= #
|