gtk_paradise 0.12.25 → 0.13.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +997 -1065
- data/bin/gtk_display_this_file +0 -2
- data/bin/run_this_widget +7 -0
- data/doc/README.gen +995 -1063
- data/doc/todo/recurring_todo_tasks.md +8 -8
- data/doc/todo/{TODO_FOR_THE_GTK_EDITOR.md → todo_for_the_gtk_editor.md} +4 -3
- data/doc/todo/{TODO_FOR_THE_GTK_PARADISE_PROJECT.md → todo_for_the_gtk_paradise_project.md} +55 -36
- data/gtk_paradise.gemspec +0 -7
- data/lib/gtk_paradise/base_module/base_module.rb +5965 -5054
- data/lib/gtk_paradise/base_module/internal_hash_module/internal_hash_module.rb +205 -0
- data/lib/gtk_paradise/{base_module_and_app_module/base_module_and_app_module.rb → base_module_and_run_module/base_module_and_run_module.rb} +5 -5
- data/lib/gtk_paradise/{base_module/widgets/widgets.rb → base_module_widgets/base_module_widgets.rb} +28 -5
- data/lib/gtk_paradise/{css_files → cascading_style_sheets}/colours.css +58 -57
- data/lib/gtk_paradise/{css_files → cascading_style_sheets}/css_accordion.css +2 -1
- data/lib/gtk_paradise/{css_files → cascading_style_sheets}/hover_effects.css +0 -1
- data/lib/gtk_paradise/{css_files → cascading_style_sheets}/project.css +16 -13
- data/lib/gtk_paradise/colours/colour_palette/material_design.rb +35 -18
- data/lib/gtk_paradise/colours/parse.rb +4 -2
- data/lib/gtk_paradise/commandline/commandline.rb +13 -7
- data/lib/gtk_paradise/constants/constants.rb +84 -174
- data/lib/gtk_paradise/{gtk_classes → core_classes}/about.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/about_dialog.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/accel_group.rb +3 -7
- data/lib/gtk_paradise/{gtk_classes → core_classes}/alignment.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/application.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/application_window.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/box.rb +11 -7
- data/lib/gtk_paradise/{gtk_classes → core_classes}/button.rb +59 -61
- data/lib/gtk_paradise/{gtk_classes → core_classes}/button_box.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/cairo/context.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/calendar.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/cell_renderer_text.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/check_button.rb +60 -58
- data/lib/gtk_paradise/{gtk_classes → core_classes}/combo_box.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/combo_box_entry.rb +5 -4
- data/lib/gtk_paradise/{gtk_classes → core_classes}/combo_box_text.rb +54 -18
- data/lib/gtk_paradise/{gtk_classes → core_classes}/dialog.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/entry.rb +17 -3
- data/lib/gtk_paradise/{gtk_classes → core_classes}/entry_completion.rb +5 -3
- data/lib/gtk_paradise/{gtk_classes → core_classes}/event_box.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/event_button.rb +6 -8
- data/lib/gtk_paradise/{gtk_classes → core_classes}/event_key.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/expander.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/file_chooser_dialog.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/file_filter.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/file_selection.rb +11 -7
- data/lib/gtk_paradise/{gtk_classes → core_classes}/frame.rb +4 -4
- data/lib/gtk_paradise/{gtk_classes → core_classes}/grid.rb +136 -80
- data/lib/gtk_paradise/{gtk_classes → core_classes}/hbox.rb +4 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/header_bar.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/hscale.rb +5 -7
- data/lib/gtk_paradise/{gtk_classes → core_classes}/image.rb +15 -12
- data/lib/gtk_paradise/{gtk_classes → core_classes}/image_menu_item.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/label.rb +29 -22
- data/lib/gtk_paradise/{gtk_classes → core_classes}/list_store.rb +6 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/menu.rb +2 -6
- data/lib/gtk_paradise/{gtk_classes → core_classes}/menu_bar.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/menu_item.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/notebook.rb +35 -20
- data/lib/gtk_paradise/{gtk_classes → core_classes}/option_menu.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/paned.rb +7 -4
- data/lib/gtk_paradise/{gtk_classes → core_classes}/popover.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/radio_button.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/radio_menu_item.rb +6 -14
- data/lib/gtk_paradise/{gtk_classes → core_classes}/scale_button.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/scrolled_window.rb +75 -48
- data/lib/gtk_paradise/{gtk_classes → core_classes}/search_bar.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/size_group.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/source_buffer.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/source_view.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/spin_button.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/spinner.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/status_icon.rb +2 -6
- data/lib/gtk_paradise/{gtk_classes → core_classes}/statusbar.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/style_context.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/text_buffer.rb +3 -7
- data/lib/gtk_paradise/{gtk_classes → core_classes}/text_tag.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/text_view.rb +19 -14
- data/lib/gtk_paradise/{gtk_classes → core_classes}/toggle_button.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/toolbar.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/tree_iter.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/tree_selection.rb +5 -3
- data/lib/gtk_paradise/{gtk_classes → core_classes}/tree_view.rb +28 -39
- data/lib/gtk_paradise/{gtk_classes → core_classes}/tree_view_column.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/vbox.rb +2 -2
- data/lib/gtk_paradise/{gtk_classes → core_classes}/vscale.rb +5 -7
- data/lib/gtk_paradise/{gtk_classes → core_classes}/vte.rb +1 -1
- data/lib/gtk_paradise/{gtk_classes → core_classes}/widget.rb +1086 -1111
- data/lib/gtk_paradise/{gtk_classes → core_classes}/window.rb +25 -12
- data/lib/gtk_paradise/drawing/README.md +2 -2
- data/lib/gtk_paradise/drawing/drawing.rb +6 -4
- data/lib/gtk_paradise/drawing/event.rb +7 -5
- data/lib/gtk_paradise/drawing/star.rb +20 -9
- data/lib/gtk_paradise/drawing/tool.rb +3 -1
- data/lib/gtk_paradise/drawing/turtle.rb +4 -2
- data/lib/gtk_paradise/emojis/emojis.rb +4 -676
- data/lib/gtk_paradise/examples/advanced/001_5x5_grid_example.rb +4 -7
- data/lib/gtk_paradise/examples/advanced/002_advanced_drag_and_drop_example.rb +3 -9
- data/lib/gtk_paradise/examples/advanced/003_html_like_support.rb +4 -11
- data/lib/gtk_paradise/examples/advanced/005_csv_example.rb +0 -2
- data/lib/gtk_paradise/examples/advanced/006_file_chooser_button_example.rb +6 -13
- data/lib/gtk_paradise/examples/advanced/007_label_responding_to_events_example.rb +5 -13
- data/lib/gtk_paradise/examples/advanced/008_options_example.rb +0 -4
- data/lib/gtk_paradise/examples/advanced/009_key_events.rb +3 -12
- data/lib/gtk_paradise/examples/advanced/010_extensive_text_view_example.rb +2 -10
- data/lib/gtk_paradise/examples/advanced/011_moving_blocks_example.rb +0 -7
- data/lib/gtk_paradise/examples/advanced/012_cell_data_sorting_example.rb +0 -4
- data/lib/gtk_paradise/examples/advanced/013_advanced_css_example.rb +3 -12
- data/lib/gtk_paradise/examples/advanced/014_popup_example.rb +3 -12
- data/lib/gtk_paradise/examples/advanced/015_advanced_button_example.rb +8 -13
- data/lib/gtk_paradise/examples/advanced/016_change_background_on_click_event.rb +0 -2
- data/lib/gtk_paradise/examples/advanced/017_lean_CSS_example.rb +2 -10
- data/lib/gtk_paradise/examples/advanced/018_coloured_text_example.rb +2 -10
- data/lib/gtk_paradise/examples/advanced/019_gtk_entry_showing_the_cursor_position.rb +1 -3
- data/lib/gtk_paradise/examples/advanced/020_scale_this_image.rb +8 -12
- data/lib/gtk_paradise/examples/advanced/021_scroll_events_on_gtk_entry.rb +0 -1
- data/lib/gtk_paradise/examples/advanced/022_autogenerated_CSS_rounded_borders.rb +15 -19
- data/lib/gtk_paradise/examples/advanced/023_append_image_to_buffer.rb +8 -14
- data/lib/gtk_paradise/examples/advanced/024_notebook_with_tab_example.rb +1 -1
- data/lib/gtk_paradise/examples/advanced/025_showing_a_gold_caret_on_black_background.rb +6 -5
- data/lib/gtk_paradise/examples/advanced/026_status_bar_example.rb +2 -5
- data/lib/gtk_paradise/examples/advanced/027_customized_frame_example.rb +4 -7
- data/lib/gtk_paradise/examples/advanced/028_widgets_described_in_a_yaml_file.rb +17 -20
- data/lib/gtk_paradise/examples/advanced/029_entry_completion_example.rb +4 -9
- data/lib/gtk_paradise/examples/advanced/030_parse_into_table_example.rb +132 -0
- data/lib/gtk_paradise/{widgets/gtk3/calculator/calculator.rb → examples/advanced/031_combo_box_example.rb} +77 -92
- data/lib/gtk_paradise/examples/cairo/three_rectangles.rb +4 -4
- data/lib/gtk_paradise/examples/controller/controller.rb +27 -24
- data/lib/gtk_paradise/examples/gir_ffi/advanced/001_advanced_treeview_example.rb +1 -1
- data/lib/gtk_paradise/examples/gir_ffi/gtk2/001_hello_world.rb +30 -0
- data/lib/gtk_paradise/examples/gir_ffi/gtk2/002_upgraded_hello_world.rb +42 -0
- data/lib/gtk_paradise/examples/gir_ffi/gtk2/004_treeview_example.rb +62 -0
- data/lib/gtk_paradise/examples/gir_ffi/gtk2/005_complex_example.rb +102 -0
- data/lib/gtk_paradise/examples/gir_ffi/gtk2/101_all_in_one_example.rb +23 -0
- data/lib/gtk_paradise/examples/gir_ffi/{005_complex_example.rb → gtk3/005_complex_example.rb} +2 -2
- data/lib/gtk_paradise/examples/glib/parse_glib_settings.rb +1 -1
- data/lib/gtk_paradise/examples/gtk2/001_tooltips_example.rb +15 -6
- data/lib/gtk_paradise/examples/gtk2/003_draw_rectangle.rb +1 -1
- data/lib/gtk_paradise/examples/gtk2/011_password_example.rb +10 -4
- data/lib/gtk_paradise/examples/gtk2/README.md +5 -0
- data/lib/gtk_paradise/examples/gtk3/001_examples_with_css.rb +320 -0
- data/lib/gtk_paradise/examples/gtk3/{077_button_box_example.rb → 003_button_box_example.rb} +13 -4
- data/lib/gtk_paradise/examples/gtk3/{056_font_chooser_dialog_example.rb → 005_font_chooser_dialog_example.rb} +3 -2
- data/lib/gtk_paradise/examples/gtk3/{073_image_example.rb → 007_image_example.rb} +4 -1
- data/lib/gtk_paradise/examples/gtk3/{051_combo_box_example.rb → 009_combo_box_example.rb} +3 -2
- data/lib/gtk_paradise/examples/gtk3/{033_list_box_example.rb → 010_list_box_example.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{021_tiny_button_via_css.rb → 013_tiny_button_via_css.rb} +4 -3
- data/lib/gtk_paradise/examples/gtk3/{025_password_example.rb → 014_password_example.rb} +3 -2
- data/lib/gtk_paradise/examples/gtk3/{047_draw_rectangles.rb → 016_draw_rectangles.rb} +4 -0
- data/lib/gtk_paradise/examples/gtk3/{005_spinner_example.rb → 017_spinner_example.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{078_tree_view_column_example.rb → 018_tree_view_column_example.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{084_recent_chooser_dialog.rb → 019_recent_chooser_dialog.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{072_text_iterator_example.rb → 021_text_iterator_example.rb} +13 -6
- data/lib/gtk_paradise/examples/gtk3/{067_gtk_label_example.rb → 024_gtk_label_example.rb} +3 -3
- data/lib/gtk_paradise/examples/gtk3/{081_vbox_with_spacing_and_border_width.rb → 032_vbox_with_spacing_and_border_width.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{006_text_view_example.rb → 034_text_view_example.rb} +2 -1
- data/lib/gtk_paradise/examples/gtk3/{054_ten_labels_in_a_vertical_box_example.rb → 036_ten_labels_in_a_vertical_box_example.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{029_sockets.rb → 039_sockets.rb} +2 -2
- data/lib/gtk_paradise/examples/gtk3/{053_revealer_example.rb → 041_revealer_example.rb} +11 -2
- data/lib/gtk_paradise/examples/gtk3/{034_hello_world_in_gtk3_and_bold_font.rb → 042_hello_world_in_gtk3_and_bold_font.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{052_notebook_css_example.rb → 043_notebook_css_example.rb} +6 -4
- data/lib/gtk_paradise/examples/gtk3/{038_radio_button_window.rb → 055_radio_button_window.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{085_showcase_the_cursors.rb → 058_showcase_the_cursors.rb} +10 -1
- data/lib/gtk_paradise/examples/gtk3/{024_small_paned_example.rb → 059_small_paned_example.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{039_scale_button_demo.rb → 060_scale_button_demo.rb} +2 -2
- data/lib/gtk_paradise/examples/gtk3/{010_switch_example.rb → 062_switch_example.rb} +2 -1
- data/lib/gtk_paradise/examples/gtk3/{009_simple_window.rb → 063_simple_window.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{043_hover_button_example_via_css.rb → 066_hover_button_example_via_css.rb} +1 -0
- data/lib/gtk_paradise/examples/gtk3/{020_stack_example.rb → 069_stack_example.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/{031_icon_theme_example.rb → 072_icon_theme_example.rb} +8 -4
- data/lib/gtk_paradise/examples/gtk3/{041_horizontal_and_vertical_scale.rb → 073_horizontal_and_vertical_scale.rb} +2 -1
- data/lib/gtk_paradise/examples/gtk3/{022_font_related_information.rb → 076_font_related_information.rb} +5 -3
- data/lib/gtk_paradise/examples/gtk3/{004_simple_dialog_example.rb → 079_simple_dialog_example.rb} +1 -1
- data/lib/gtk_paradise/examples/gtk3/vte/vte3_terminal.rb +1 -1
- data/lib/gtk_paradise/examples/gtk4/001_examples_with_css.rb +320 -0
- data/lib/gtk_paradise/examples/gtk4/{076_ten_vboxes_example.rb → 023_ten_vboxes_example.rb} +10 -10
- data/lib/gtk_paradise/examples/gtk4/{030_notebook_example.rb → 061_notebook_example.rb} +3 -4
- data/lib/gtk_paradise/examples/gtk4/{007_two_windows_example.rb → 087_two_windows_example.rb} +4 -1
- data/lib/gtk_paradise/examples/gtk4/{100_changed_events_example.rb → 200_changed_events_example.rb} +0 -1
- data/lib/gtk_paradise/examples/gtk4/{102_picture_example.rb → 202_picture_example.rb} +1 -1
- data/lib/gtk_paradise/examples/pango/pango_power.rb +11 -6
- data/lib/gtk_paradise/experimental/experimental.rb +2 -2
- data/lib/gtk_paradise/gdk/event_crossing.rb +1 -1
- data/lib/gtk_paradise/gdk/gdk.rb +3 -29
- data/lib/gtk_paradise/gdk/screen.rb +29 -0
- data/lib/gtk_paradise/gnome/README.md +3 -0
- data/lib/gtk_paradise/hello_world/README.md +7 -7
- data/lib/gtk_paradise/hello_world/hello_world_gtk4.rb +1 -1
- data/lib/gtk_paradise/images/misc/investigate.png +0 -0
- data/lib/gtk_paradise/pango/fonts.rb +1 -3
- data/lib/gtk_paradise/pango/pango_renderer.rb +2 -0
- data/lib/gtk_paradise/project/project.rb +2 -1
- data/lib/gtk_paradise/prototypes/gtk3_standalone.rb +7 -7
- data/lib/gtk_paradise/prototypes/gtk4_standalone.rb +1 -1
- data/lib/gtk_paradise/prototypes/unified_gtk_prototype.rb +1 -1
- data/lib/gtk_paradise/requires/{base_module_and_app_module.rb → base_module_and_run_module.rb} +1 -1
- data/lib/gtk_paradise/requires/do_require_the_files_under_the_gtk_classes_subdirectory.rb +2 -2
- data/lib/gtk_paradise/requires/require_files_irrespective_of_the_gtk_version_at_hand.rb +2 -2
- data/lib/gtk_paradise/requires/require_gtk2.rb +16 -3
- data/lib/gtk_paradise/requires/require_gtk3.rb +7 -3
- data/lib/gtk_paradise/requires/{require_gtk2_or_gtk3_or_gtk4.rb → require_gtk3_or_gtk4.rb} +1 -3
- data/lib/gtk_paradise/requires/require_gtk4.rb +7 -4
- 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 → require_the_base_module_the_run_module_and_the_toplevel_methods.rb} +2 -2
- data/lib/gtk_paradise/requires/require_the_base_module_widgets.rb +9 -0
- data/lib/gtk_paradise/requires/require_the_default_gtk_version.rb +1 -1
- data/lib/gtk_paradise/requires/run_this_widget.rb +1 -1
- data/lib/gtk_paradise/run/run.rb +410 -0
- data/lib/gtk_paradise/run.rb +5 -29
- data/lib/gtk_paradise/{app/app_module/app_module.rb → run_module/run_module.rb} +946 -1016
- data/lib/gtk_paradise/toplevel_methods/css.rb +18 -15
- data/lib/gtk_paradise/toplevel_methods/cursor.rb +5 -4
- data/lib/gtk_paradise/toplevel_methods/determine_which_gtk_version_is_in_use.rb +1 -1
- data/lib/gtk_paradise/toplevel_methods/e.rb +12 -0
- data/lib/gtk_paradise/toplevel_methods/keys.rb +1 -1
- data/lib/gtk_paradise/toplevel_methods/screen_resolution.rb +7 -6
- data/lib/gtk_paradise/toplevel_methods/{text_buffer_tags.rb → tokenizer_and_text_buffer_tags.rb} +115 -0
- data/lib/gtk_paradise/toplevel_methods/toplevel_methods.rb +667 -673
- data/lib/gtk_paradise/utility_scripts/commandline_to_automatic_gui.rb +8 -8
- data/lib/gtk_paradise/utility_scripts/generate_gtk_prototype.rb +5 -31
- data/lib/gtk_paradise/version/upstream_gtk_version.rb +3 -25
- data/lib/gtk_paradise/version/version.rb +4 -3
- data/lib/gtk_paradise/widgets/gtk2/README.md +5 -0
- data/lib/gtk_paradise/widgets/gtk2/pdfwalker/imgview.rb +1 -2
- data/lib/gtk_paradise/widgets/gtk2/table_example.rb +0 -1
- data/lib/gtk_paradise/widgets/gtk3/audio_button/audio_button.rb +13 -7
- data/lib/gtk_paradise/widgets/gtk3/burn_this_iso_file/burn_this_iso_file.rb +5 -21
- data/lib/gtk_paradise/widgets/gtk3/button_open_remote_webpage/button_open_remote_webpage.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/button_with_border/button_with_border.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/button_xorg_buffer/button_xorg_buffer.rb +6 -20
- data/lib/gtk_paradise/widgets/gtk3/checkbox_image/checkbox_image.rb +4 -20
- data/lib/gtk_paradise/widgets/gtk3/coloured_button/coloured_button.rb +3 -6
- data/lib/gtk_paradise/widgets/gtk3/coloured_unit/coloured_unit.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/cpu_widget/cpu_widget.rb +3 -15
- data/lib/gtk_paradise/widgets/gtk3/directory_content_widget/directory_content_widget.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/editor/editor.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/editor/internal_widgets/goto_line_widget.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/files_in_directory/files_in_directory.rb +1 -13
- data/lib/gtk_paradise/widgets/gtk3/font_size_widget/action_button.rb +2 -4
- data/lib/gtk_paradise/widgets/gtk3/font_size_widget/font_size_widget.rb +6 -27
- data/lib/gtk_paradise/widgets/gtk3/four_components_entry/four_components_entry.rb +8 -8
- data/lib/gtk_paradise/widgets/gtk3/gidnight_commander/gidnight_commander.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/image_viewer/image_viewer.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/keyboard/keyboard.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/linux_users/linux_users.rb +9 -9
- data/lib/gtk_paradise/widgets/gtk3/my_calendar/my_calendar.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/my_image_menu_item/my_image_menu_item.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/non_numbers_only/non_numbers_only.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/note_window/note_window.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/notebook_tab_with_icon/notebook_tab_with_icon.rb +2 -3
- data/lib/gtk_paradise/widgets/gtk3/notebook_with_storage_functionality/notebook_with_storage_functionality.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/numbers_only/numbers_only.rb +9 -3
- data/lib/gtk_paradise/widgets/gtk3/regex_matcher/regex_matcher.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/rename_widget/rename_widget.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/show_which_key_was_pressed/show_which_key_was_pressed.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/stopwatch/stopwatch.rb +12 -14
- data/lib/gtk_paradise/widgets/gtk3/sys_message/sys_message.rb +2 -4
- data/lib/gtk_paradise/widgets/gtk3/system_information/system_information.rb +2 -2
- data/lib/gtk_paradise/widgets/gtk3/type_trainer/type_trainer.rb +14 -6
- data/lib/gtk_paradise/widgets/gtk3/view_webpage/view_webpage.rb +16 -28
- data/lib/gtk_paradise/widgets/gtk3/widget_switcher/widget_switcher.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk3/wiki/README.md +3 -4
- data/lib/gtk_paradise/widgets/gtk3/wiki/wiki.rb +13 -15
- data/lib/gtk_paradise/widgets/gtk4/show_icon_theme/show_icon_theme.rb +1 -1
- data/lib/gtk_paradise/widgets/gtk4/sys_message/sys_message.rb +1 -1
- data/lib/gtk_paradise/widgets/shared_code/browser/browser_module.rb +5 -8
- data/lib/gtk_paradise/widgets/shared_code/burning_widget/burning_widget_module.rb +3 -20
- data/lib/gtk_paradise/widgets/shared_code/cdripper/cdripper_module.rb +2 -18
- data/lib/gtk_paradise/widgets/shared_code/colour_filled_widget/colour_filled_widget_module.rb +2 -3
- data/lib/gtk_paradise/widgets/shared_code/colour_palette/colour_palette_module.rb +4 -20
- data/lib/gtk_paradise/widgets/shared_code/conky/conky_module.rb +18 -29
- data/lib/gtk_paradise/widgets/shared_code/customizable_dialog/customizable_dialog.rb +1 -6
- data/lib/gtk_paradise/widgets/shared_code/emoji_toggle_widget/emoji_toggle_widget_module.rb +2 -14
- data/lib/gtk_paradise/widgets/shared_code/emoji_widget/emoji_widget_module.rb +3 -12
- data/lib/gtk_paradise/widgets/shared_code/error_widget/error_widget_module.rb +4 -8
- data/lib/gtk_paradise/widgets/shared_code/file_path_widget/file_path_widget_module.rb +5 -3
- data/lib/gtk_paradise/widgets/shared_code/file_viewer/file_viewer_module.rb +2 -34
- data/lib/gtk_paradise/widgets/shared_code/lsmod/lsmod_module.rb +1 -1
- data/lib/gtk_paradise/widgets/shared_code/lspci/lspci_module.rb +2 -5
- data/lib/gtk_paradise/widgets/shared_code/mini_clock/mini_clock_module.rb +1 -3
- data/lib/gtk_paradise/widgets/shared_code/pid_displayer/pid_displayer_module.rb +7 -18
- data/lib/gtk_paradise/widgets/shared_code/random_image/random_image_module.rb +6 -18
- data/lib/gtk_paradise/widgets/shared_code/select_file/select_file_module.rb +2 -18
- data/lib/gtk_paradise/widgets/shared_code/user/user_module.rb +43 -32
- data/lib/gtk_paradise/widgets/shared_code/wget_wrapper/wget_wrapper_module.rb +10 -27
- data/lib/gtk_paradise/www/index.cgi +4 -4
- data/lib/gtk_paradise/xbm_icons/xbm_icons.rb +118 -0
- data/lib/gtk_paradise/yaml/browser_URLs.yml +4 -4
- data/lib/gtk_paradise/yaml/notebook_controller.yml +0 -2
- data/lib/gtk_paradise.rb +0 -0
- data/test/gir_ffi_gtk/testing_gir_ffi_gtk2.rb +55 -0
- data/test/gir_ffi_gtk/testing_gir_ffi_gtk3.rb +55 -0
- data/test/gtk3/testing_app.rb +1 -1
- data/test/gtk3/testing_base_module.rb +13 -7
- data/test/misc/testing_a_gtk_frame.rb +3 -2
- data/test/misc/testing_gtk4_simplifications.rb +2 -4
- data/test/misc/testing_gtk_paradise_runner.rb +3 -4
- data/test/misc/testing_numbered_lines.rb +2 -0
- data/test/misc/testing_the_gtk_classes.rb +1 -1
- metadata +234 -236
- data/lib/gtk_paradise/app/app.rb +0 -239
- data/lib/gtk_paradise/base_module/class_methods/class_methods.rb +0 -0
- data/lib/gtk_paradise/base_module/colours.rb +0 -125
- data/lib/gtk_paradise/base_module/css.rb +0 -487
- data/lib/gtk_paradise/base_module/html_support.rb +0 -255
- data/lib/gtk_paradise/base_module/these_methods_work_for_gtk3_and_gtk4.rb +0 -171
- data/lib/gtk_paradise/examples/gtk3/063_examples_with_css.rb +0 -261
- data/lib/gtk_paradise/examples/gtk4/009_text_view_example.rb +0 -30
- data/lib/gtk_paradise/requires/require_base_module.rb +0 -7
- data/lib/gtk_paradise/run_this_widget/run_this_widget.rb +0 -129
- data/lib/gtk_paradise/toplevel_methods/tokenizer.rb +0 -118
- data/lib/gtk_paradise/widgets/gtk3/ping_widget/ping_widget.rb +0 -513
- data/lib/gtk_paradise/widgets/shared_code/calculator/calculator_module.rb +0 -581
- data/lib/gtk_paradise/widgets/shared_code/simple_clock/simple_clock_module.rb +0 -255
- /data/lib/gtk_paradise/{css_files → cascading_style_sheets}/borders.css +0 -0
- /data/lib/gtk_paradise/{css_files → cascading_style_sheets}/themes/README.md +0 -0
- /data/lib/gtk_paradise/{css_files → cascading_style_sheets}/themes/rainbow_theme.css +0 -0
- /data/lib/gtk_paradise/examples/gdk/{001_gdk_screen_properties.rb → gdk_screen_properties.rb} +0 -0
- /data/lib/gtk_paradise/examples/gir_ffi/{001_hello_world.rb → gtk3/001_hello_world.rb} +0 -0
- /data/lib/gtk_paradise/examples/gir_ffi/{002_upgraded_hello_world.rb → gtk3/002_upgraded_hello_world.rb} +0 -0
- /data/lib/gtk_paradise/examples/gir_ffi/{003_gtk_application_example.rb → gtk3/003_gtk_application_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gir_ffi/{004_treeview_example.rb → gtk3/004_treeview_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{001_gtk_entry.rb → 002_gtk_entry.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{075_gtk_expander.rb → 004_gtk_expander.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{036_buttons_showcasing_the_relief.rb → 006_buttons_showcasing_the_relief.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{050_cell_renderer_pixbuf_example.rb → 008_cell_renderer_pixbuf_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{044_spin_button_example.rb → 011_spin_button_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{064_accel_group_example.rb → 012_accel_group_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{048_colour_choose_button.rb → 015_colour_choose_button.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{086_app_chooser_button_example.rb → 020_app_chooser_button_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{018_message_dialog_example.rb → 022_message_dialog_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{076_ten_vboxes_example.rb → 023_ten_vboxes_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{071_button_demo.rb → 025_button_demo.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{074_frame_example.rb → 026_frame_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{080_vertical_boxes.rb → 027_vertical_boxes.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{032_switcher_window.rb → 028_switcher_window.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{057_flowbox.rb → 029_flowbox.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{066_header_bar_example.rb → 030_header_bar_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{049_drag_and_drop_example.rb → 031_drag_and_drop_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{055_threads_example.rb → 033_threads_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{079_tooltips_example.rb → 035_tooltips_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{087_calendar_example.rb → 037_calendar_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{060_check_button.rb → 038_check_button.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{062_event_box_example.rb → 040_event_box_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{042_installation_assistant.rb → 044_installation_assistant.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{053_css_example_of_a_button_changing_the_background_colour_on_click_event.rb → 045_css_example_of_a_button_changing_the_background_colour_on_click_event.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{017_extensive_markup_example.rb → 046_extensive_markup_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{059_form_example.rb → 047_form_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{068_popover_example.rb → 048_popover_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{012_show_the_xid_example.rb → 049_show_the_xid_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{016_scrolling_example.rb → 050_scrolling_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{065_change_the_application_theme.rb → 051_change_the_application_theme.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{058_colourized_button_example.rb → 052_colourized_button_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{035_grid_example.rb → 053_grid_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{027_menubar_example.rb → 054_menubar_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{040_popup_example.rb → 056_popup_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{069_entry_completion.rb → 057_entry_completion.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{030_notebook_example.rb → 061_notebook_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{014_undecorated_window_example.rb → 064_undecorated_window_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{026_progress_bar_example.rb → 065_progress_bar_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{028_paned_widget_example.rb → 067_paned_widget_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{082_file_chooser_dialog.rb → 068_file_chooser_dialog.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{037_text_buffer_example.rb → 070_text_buffer_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{013_grab_pointer_forcefully.rb → 071_grab_pointer_forcefully.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{008_search_bar_example.rb → 074_search_bar_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{061_fixed_example.rb → 075_fixed_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{011_colour_chooser_example.rb → 077_colour_chooser_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{015_bottom_left_placement.rb → 078_bottom_left_placement.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{045_radio_menu_item_example.rb → 080_radio_menu_item_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{046_gtk_dialog_sample.rb → 081_gtk_dialog_sample.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{003_toggle_button_example.rb → 082_toggle_button_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{019_status_icon_example.rb → 083_status_icon_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{023_sorted_tree.rb → 084_sorted_tree.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{083_bindings.rb → 085_bindings.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{002_scrolled_window_example.rb → 086_scrolled_window_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{007_two_windows_example.rb → 087_two_windows_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk3/{070_svg_viewer.rb → 088_svg_viewer.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{001_gtk_entry.rb → 002_gtk_entry.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{005_spinner_example.rb → 017_spinner_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{074_frame_example.rb → 026_frame_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{006_text_view_example.rb → 034_text_view_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{087_calendar_example.rb → 037_calendar_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{027_menubar_example.rb → 054_menubar_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{010_switch_example.rb → 062_switch_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{008_search_bar_example.rb → 074_search_bar_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{004_simple_dialog_example.rb → 079_simple_dialog_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{003_toggle_button_example.rb → 082_toggle_button_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{002_scrolled_window_example.rb → 086_scrolled_window_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{101_actionbar_example.rb → 201_actionbar_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{103_drawing_example.rb → 203_drawing_example.rb} +0 -0
- /data/lib/gtk_paradise/examples/gtk4/{104_quit_on_keypress_event.rb → 204_quit_on_keypress_event.rb} +0 -0
- /data/lib/gtk_paradise/widgets/gtk2/{status_icon_example.rb → status_icon_example/status_icon_example.rb} +0 -0
@@ -1,255 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
# Encoding: UTF-8
|
3
|
-
# frozen_string_literal: true
|
4
|
-
# =========================================================================== #
|
5
|
-
# This file will contain "html-tags" that may be used - and useful - for
|
6
|
-
# ruby-gtk applications.
|
7
|
-
#
|
8
|
-
# Some of these html-tags are tested via ruby-code. For example, the
|
9
|
-
# headers (h1, h2, h3, h4, h5 and h6) are tested in the file called
|
10
|
-
# testing_the_html_pseudo_tags.rb, in the test/gtk3/ subdirectory.
|
11
|
-
# =========================================================================== #
|
12
|
-
# require 'gtk_paradise/base_module/html_support.rb'
|
13
|
-
# =========================================================================== #
|
14
|
-
module Gtk
|
15
|
-
|
16
|
-
module BaseModule
|
17
|
-
|
18
|
-
# ========================================================================= #
|
19
|
-
# === HASH_USE_THESE_PERCENTAGE_VALUES_FOR_THE_HEADERS
|
20
|
-
#
|
21
|
-
# This sets the corresponding font-size, as a percentage value. The
|
22
|
-
# default is 100%, so all headers must be larger than 100%.
|
23
|
-
#
|
24
|
-
# The following link has some percentage values:
|
25
|
-
#
|
26
|
-
# http://www.metahead.com/converting-font-sizes-from-pixel-point-em-percent/
|
27
|
-
#
|
28
|
-
# So 12pt is 100%. 18pt is 150%.
|
29
|
-
#
|
30
|
-
# And on this page:
|
31
|
-
#
|
32
|
-
# http://zuga.net/articles/html-heading-elements/
|
33
|
-
#
|
34
|
-
# The listing for the headers is:
|
35
|
-
#
|
36
|
-
# 32px 24px 18.72px 16px 13.28px 10.72px
|
37
|
-
#
|
38
|
-
# ========================================================================= #
|
39
|
-
HASH_USE_THESE_PERCENTAGE_VALUES_FOR_THE_HEADERS = {
|
40
|
-
h1: '200%', # 32 px
|
41
|
-
h2: '180%', # 24 px
|
42
|
-
h3: '150%', # 18.72 px
|
43
|
-
h4: '130%', # 16 px
|
44
|
-
h5: '125%', # 13.28 px
|
45
|
-
h6: '115%' # 10.72 px
|
46
|
-
}
|
47
|
-
|
48
|
-
# ========================================================================= #
|
49
|
-
# === return_p_tag
|
50
|
-
#
|
51
|
-
# This method shall ultimately simulate a <p> tag. We will assume
|
52
|
-
# that a gtk-hbox can handle a paragraph properly.
|
53
|
-
# ========================================================================= #
|
54
|
-
def return_p_tag(
|
55
|
-
optional_css_class = '',
|
56
|
-
&block
|
57
|
-
)
|
58
|
-
optional_css_class = optional_css_class.to_s # Need a String past this point.
|
59
|
-
p_paragraph = gtk_hbox(&block)
|
60
|
-
if optional_css_class and !optional_css_class.empty?
|
61
|
-
_ = [optional_css_class]
|
62
|
-
_.each {|entry|
|
63
|
-
if entry.include? ' '
|
64
|
-
entry.split(' ').each {|inner_entry| p_paragraph.add_css_class(inner_entry) }
|
65
|
-
else
|
66
|
-
p_paragraph.add_css_class(entry)
|
67
|
-
end
|
68
|
-
}
|
69
|
-
end
|
70
|
-
return p_paragraph
|
71
|
-
end
|
72
|
-
|
73
|
-
# ========================================================================= #
|
74
|
-
# === p (p tag)
|
75
|
-
# ========================================================================= #
|
76
|
-
def p(
|
77
|
-
optional_css_class = '',
|
78
|
-
&block
|
79
|
-
)
|
80
|
-
minimal(
|
81
|
-
return_p_tag(optional_css_class, &block)
|
82
|
-
)
|
83
|
-
end
|
84
|
-
|
85
|
-
# ========================================================================= #
|
86
|
-
# === h1 (h1 tag)
|
87
|
-
# ========================================================================= #
|
88
|
-
def h1(
|
89
|
-
i = '',
|
90
|
-
optional_css_class = ''
|
91
|
-
)
|
92
|
-
label = gtk_label(i)
|
93
|
-
label.increase_the_font_size_to(HASH_USE_THESE_PERCENTAGE_VALUES_FOR_THE_HEADERS[:h1]) # Make the <h1> tag larger.
|
94
|
-
if optional_css_class and !optional_css_class.empty?
|
95
|
-
_ = [optional_css_class]
|
96
|
-
_.each {|entry|
|
97
|
-
if entry.include? ' '
|
98
|
-
entry.split(' ').each {|inner_entry| label.add_css_class(inner_entry) }
|
99
|
-
else
|
100
|
-
label.add_css_class(entry)
|
101
|
-
end
|
102
|
-
}
|
103
|
-
end
|
104
|
-
label.left_align
|
105
|
-
return label
|
106
|
-
end
|
107
|
-
|
108
|
-
# ========================================================================= #
|
109
|
-
# === h2 (h2 tag)
|
110
|
-
# ========================================================================= #
|
111
|
-
def h2(
|
112
|
-
i = '',
|
113
|
-
optional_css_class = ''
|
114
|
-
)
|
115
|
-
label = gtk_label(i)
|
116
|
-
label.increase_the_font_size_to(HASH_USE_THESE_PERCENTAGE_VALUES_FOR_THE_HEADERS[:h2]) # Make the <h2> tag larger.
|
117
|
-
if optional_css_class and !optional_css_class.empty?
|
118
|
-
_ = [optional_css_class]
|
119
|
-
_.each {|entry|
|
120
|
-
if entry.include? ' '
|
121
|
-
entry.split(' ').each {|inner_entry| label.add_css_class(inner_entry) }
|
122
|
-
else
|
123
|
-
label.add_css_class(entry)
|
124
|
-
end
|
125
|
-
}
|
126
|
-
end
|
127
|
-
label.left_align
|
128
|
-
return label
|
129
|
-
end
|
130
|
-
|
131
|
-
# ========================================================================= #
|
132
|
-
# === h3 (h3 tag)
|
133
|
-
# ========================================================================= #
|
134
|
-
def h3(
|
135
|
-
i = '',
|
136
|
-
optional_css_class = ''
|
137
|
-
)
|
138
|
-
label = gtk_label(i)
|
139
|
-
label.increase_the_font_size_to(HASH_USE_THESE_PERCENTAGE_VALUES_FOR_THE_HEADERS[:h3]) # Make the <h3> tag larger.
|
140
|
-
if optional_css_class and !optional_css_class.empty?
|
141
|
-
_ = [optional_css_class]
|
142
|
-
_.each {|entry|
|
143
|
-
if entry.include? ' '
|
144
|
-
entry.split(' ').each {|inner_entry| label.add_css_class(inner_entry) }
|
145
|
-
else
|
146
|
-
label.add_css_class(entry)
|
147
|
-
end
|
148
|
-
}
|
149
|
-
end
|
150
|
-
label.left_align
|
151
|
-
return label
|
152
|
-
end
|
153
|
-
|
154
|
-
# ========================================================================= #
|
155
|
-
# === h4 (h4 tag)
|
156
|
-
# ========================================================================= #
|
157
|
-
def h4(
|
158
|
-
i = '',
|
159
|
-
optional_css_class = ''
|
160
|
-
)
|
161
|
-
label = gtk_label(i)
|
162
|
-
label.increase_the_font_size_to(HASH_USE_THESE_PERCENTAGE_VALUES_FOR_THE_HEADERS[:h4]) # Make the <h4> tag larger.
|
163
|
-
if optional_css_class and !optional_css_class.empty?
|
164
|
-
_ = [optional_css_class]
|
165
|
-
_.each {|entry|
|
166
|
-
if entry.include? ' '
|
167
|
-
entry.split(' ').each {|inner_entry| label.add_css_class(inner_entry) }
|
168
|
-
else
|
169
|
-
label.add_css_class(entry)
|
170
|
-
end
|
171
|
-
}
|
172
|
-
end
|
173
|
-
label.left_align
|
174
|
-
return label
|
175
|
-
end
|
176
|
-
|
177
|
-
# ========================================================================= #
|
178
|
-
# === h5 (h5 tag)
|
179
|
-
# ========================================================================= #
|
180
|
-
def h5(
|
181
|
-
i = '',
|
182
|
-
optional_css_class = ''
|
183
|
-
)
|
184
|
-
label = gtk_label(i)
|
185
|
-
label.increase_the_font_size_to(HASH_USE_THESE_PERCENTAGE_VALUES_FOR_THE_HEADERS[:h5]) # Make the <h5> tag larger.
|
186
|
-
if optional_css_class and !optional_css_class.empty?
|
187
|
-
_ = [optional_css_class]
|
188
|
-
_.each {|entry|
|
189
|
-
if entry.include? ' '
|
190
|
-
entry.split(' ').each {|inner_entry| label.add_css_class(inner_entry) }
|
191
|
-
else
|
192
|
-
label.add_css_class(entry)
|
193
|
-
end
|
194
|
-
}
|
195
|
-
end
|
196
|
-
label.left_align
|
197
|
-
return label
|
198
|
-
end
|
199
|
-
|
200
|
-
# ========================================================================= #
|
201
|
-
# === h6 (h6 tag)
|
202
|
-
# ========================================================================= #
|
203
|
-
def h6(
|
204
|
-
i = '',
|
205
|
-
optional_css_class = ''
|
206
|
-
)
|
207
|
-
label = gtk_label(i)
|
208
|
-
label.increase_the_font_size_to(HASH_USE_THESE_PERCENTAGE_VALUES_FOR_THE_HEADERS[:h6]) # Make the <h6> tag larger.
|
209
|
-
if optional_css_class and !optional_css_class.empty?
|
210
|
-
_ = [optional_css_class]
|
211
|
-
_.each {|entry|
|
212
|
-
if entry.include? ' '
|
213
|
-
entry.split(' ').each {|inner_entry| label.add_css_class(inner_entry) }
|
214
|
-
else
|
215
|
-
label.add_css_class(entry)
|
216
|
-
end
|
217
|
-
}
|
218
|
-
end
|
219
|
-
label.left_align
|
220
|
-
return label
|
221
|
-
end
|
222
|
-
|
223
|
-
# ========================================================================= #
|
224
|
-
# === pre (pre tag)
|
225
|
-
#
|
226
|
-
# This shall be an approximation of the <pre> tag in HTML.
|
227
|
-
# ========================================================================= #
|
228
|
-
def pre(i = '')
|
229
|
-
label = gtk_label(i)
|
230
|
-
label.set_line_wrap(true) # See: https://ruby-gnome2.osdn.jp/hiki.cgi?Gtk%3A%3ALabel
|
231
|
-
return label
|
232
|
-
end
|
233
|
-
|
234
|
-
# ========================================================================= #
|
235
|
-
# === div
|
236
|
-
#
|
237
|
-
# This method shall ultimately simulate a <div> tag. For now this will
|
238
|
-
# be assumed to be a gtk-vbox.
|
239
|
-
# ========================================================================= #
|
240
|
-
def div(&block)
|
241
|
-
gtk_hbox(&block)
|
242
|
-
end
|
243
|
-
|
244
|
-
# ========================================================================= #
|
245
|
-
# === sbr
|
246
|
-
#
|
247
|
-
# This is normally aliased to e as well, but e is already an alias to
|
248
|
-
# "puts", so we can not use this. The "br" in sbr stands for <br>, so
|
249
|
-
# a newline ultimately - hence the "\n" that is appended in the method.
|
250
|
-
# ========================================================================= #
|
251
|
-
def sbr(i = '')
|
252
|
-
gtk_label("#{i}\n")
|
253
|
-
end
|
254
|
-
|
255
|
-
end; end
|
@@ -1,171 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
# Encoding: UTF-8
|
3
|
-
# frozen_string_literal: true
|
4
|
-
# =========================================================================== #
|
5
|
-
# require 'gtk_paradise/base_module/these_methods_work_for_gtk3_and_gtk4.rb'
|
6
|
-
# =========================================================================== #
|
7
|
-
module Gtk
|
8
|
-
|
9
|
-
module BaseModule # === Gtk::BaseModule
|
10
|
-
|
11
|
-
require 'gtk_paradise/gtk_classes/grid.rb'
|
12
|
-
|
13
|
-
require 'gtk_paradise/toplevel_methods/toplevel_methods.rb'
|
14
|
-
# ========================================================================= #
|
15
|
-
# === is_on_roebe?
|
16
|
-
# ========================================================================= #
|
17
|
-
def is_on_roebe?
|
18
|
-
::Gtk.is_on_roebe?
|
19
|
-
end
|
20
|
-
|
21
|
-
# ========================================================================= #
|
22
|
-
# === gtk_grid
|
23
|
-
#
|
24
|
-
# Usage examples:
|
25
|
-
#
|
26
|
-
# g = Gtk::Grid.new
|
27
|
-
# g.attach(Gtk::Button.new(label: 'Button'), 0, 0, 1, 1)
|
28
|
-
# g.attach(Gtk::CheckButton.new(''), 1, 0, 1, 1)
|
29
|
-
#
|
30
|
-
# Or:
|
31
|
-
#
|
32
|
-
# grid = gtk_grid { :default }
|
33
|
-
# grid.left(text('This is left.'))
|
34
|
-
# grid.middle(text('This is middle.'))
|
35
|
-
# grid.right(text('This is right.'))
|
36
|
-
#
|
37
|
-
# ========================================================================= #
|
38
|
-
def gtk_grid(
|
39
|
-
optional_arguments = '',
|
40
|
-
&block
|
41
|
-
)
|
42
|
-
_ = ::Gtk::Grid.new
|
43
|
-
if optional_arguments and optional_arguments.include?('x')
|
44
|
-
# ===================================================================== #
|
45
|
-
# For instance:
|
46
|
-
#
|
47
|
-
# grid1 = create_grid('1x2')
|
48
|
-
#
|
49
|
-
# This is currently ignored, though, as grids in gtk behave slightly
|
50
|
-
# differently.
|
51
|
-
# ===================================================================== #
|
52
|
-
end
|
53
|
-
# ======================================================================= #
|
54
|
-
# === Handle blocks given to this method next
|
55
|
-
# ======================================================================= #
|
56
|
-
if block_given?
|
57
|
-
yielded = yield
|
58
|
-
case yielded
|
59
|
-
# ===================================================================== #
|
60
|
-
# === :default
|
61
|
-
#
|
62
|
-
# This entry point specifies a few defaults that I consider somewhat
|
63
|
-
# useful.
|
64
|
-
# ===================================================================== #
|
65
|
-
when :default
|
66
|
-
_.set_column_spacing(2)
|
67
|
-
_.set_row_spacing(2)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
return _
|
71
|
-
end; alias grid gtk_grid # === grid
|
72
|
-
alias create_grid gtk_grid # === create_grid
|
73
|
-
|
74
|
-
# ========================================================================= #
|
75
|
-
# === return_default_grid
|
76
|
-
# ========================================================================= #
|
77
|
-
def return_default_grid
|
78
|
-
return gtk_grid { :default }
|
79
|
-
end; alias default_grid return_default_grid # === default_grid
|
80
|
-
alias default_gtk_grid return_default_grid # === default_gtk_grid
|
81
|
-
alias gtk_default_grid return_default_grid # === gtk_default_grid
|
82
|
-
alias create_default_grid return_default_grid # === create_default_grid
|
83
|
-
|
84
|
-
# ========================================================================= #
|
85
|
-
# === max_width?
|
86
|
-
#
|
87
|
-
# Alternatively we could use ::Gtk.max_width?.
|
88
|
-
# ========================================================================= #
|
89
|
-
def max_width?
|
90
|
-
::Gtk.max_width?
|
91
|
-
end; alias original_width? max_width? # === original_width?
|
92
|
-
|
93
|
-
# ========================================================================= #
|
94
|
-
# === max_resolution?
|
95
|
-
#
|
96
|
-
# This method will return an Array such as [1920, 1080] - maximum width
|
97
|
-
# first, then maximum height.
|
98
|
-
# ========================================================================= #
|
99
|
-
def max_resolution?
|
100
|
-
::Gtk.resolution?
|
101
|
-
end
|
102
|
-
|
103
|
-
# ========================================================================= #
|
104
|
-
# === gtk_centered_spin_button
|
105
|
-
# ========================================================================= #
|
106
|
-
def gtk_centered_spin_button(
|
107
|
-
start_position = 0,
|
108
|
-
end_position = 100,
|
109
|
-
increment_size = 1,
|
110
|
-
&block
|
111
|
-
)
|
112
|
-
_ = gtk_spin_button(
|
113
|
-
start_position,
|
114
|
-
end_position,
|
115
|
-
increment_size,
|
116
|
-
&block
|
117
|
-
)
|
118
|
-
_.center
|
119
|
-
return _
|
120
|
-
end; alias centered_spin_button gtk_centered_spin_button # === centered_spin_button
|
121
|
-
|
122
|
-
# ========================================================================= #
|
123
|
-
# === max_height?
|
124
|
-
# ========================================================================= #
|
125
|
-
def max_height?
|
126
|
-
return Gtk.resolution?.last # .last is height.
|
127
|
-
end
|
128
|
-
|
129
|
-
# ========================================================================= #
|
130
|
-
# === set_width
|
131
|
-
# ========================================================================= #
|
132
|
-
def set_width(i)
|
133
|
-
i = ::Gtk.calculate_the_true_value_represented_via_a_percentage_value(i)
|
134
|
-
@internal_hash[:width] = i.to_i
|
135
|
-
end
|
136
|
-
|
137
|
-
require 'gtk_paradise/gtk_classes/spin_button.rb'
|
138
|
-
# ========================================================================= #
|
139
|
-
# === gtk_spin_button
|
140
|
-
#
|
141
|
-
# Note that the values that are given to Gtk::SpinButton specify
|
142
|
-
# min, max and range. The default that is used in the method
|
143
|
-
# must make "sense", meaning it has to refer to "the most commonly
|
144
|
-
# assumed use case" for a spin-button. I somewhat arbitrarily
|
145
|
-
# decided that this means to start at 0, count up to 100, in
|
146
|
-
# steps of 1. Obviously this is arbitrary, but other values are
|
147
|
-
# just about as arbitrary as well - so I thought counting up to
|
148
|
-
# 100 would make sense here.
|
149
|
-
#
|
150
|
-
# Usage examples:
|
151
|
-
#
|
152
|
-
# gtk_spin_button(0, 300, 1)
|
153
|
-
# spinner_button = gtk_spinner_button {{ start_point: 1 }}
|
154
|
-
#
|
155
|
-
# ========================================================================= #
|
156
|
-
def gtk_spin_button(
|
157
|
-
start_position = 0,
|
158
|
-
end_position = 100,
|
159
|
-
increment_size = 1,
|
160
|
-
&block
|
161
|
-
)
|
162
|
-
return ::Gtk.spin_button(start_position, end_position, increment_size)
|
163
|
-
end; alias spin_button gtk_spin_button # === spin_button
|
164
|
-
alias spinbutton gtk_spin_button # === spinbutton
|
165
|
-
alias gtk_spinner_button gtk_spin_button # === gtk_spinner_button
|
166
|
-
alias gtk_spinbutton gtk_spin_button # === gtk_spinbutton
|
167
|
-
alias create_spinbutton gtk_spin_button # === create_spinbutton
|
168
|
-
alias gtk_up_and_down_counter gtk_spin_button # === gtk_up_and_down_counter
|
169
|
-
alias up_and_down_counter gtk_spin_button # === up_and_down_counter
|
170
|
-
|
171
|
-
end; end
|
@@ -1,261 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby -w
|
2
|
-
# Encoding: UTF-8
|
3
|
-
# frozen_string_literal: true
|
4
|
-
# =========================================================================== #
|
5
|
-
# 'css_example.rb'
|
6
|
-
# =========================================================================== #
|
7
|
-
require 'gtk3'
|
8
|
-
|
9
|
-
alias e puts
|
10
|
-
|
11
|
-
# =========================================================================== #
|
12
|
-
# === USE_THIS_AS_THE_CSS_STRING
|
13
|
-
# =========================================================================== #
|
14
|
-
USE_THIS_AS_THE_CSS_STRING = <<-EOF
|
15
|
-
|
16
|
-
button {
|
17
|
-
background-image: none;
|
18
|
-
background-color: yellow;
|
19
|
-
border: 3px solid black;
|
20
|
-
}
|
21
|
-
|
22
|
-
button:hover {
|
23
|
-
color: royalblue;
|
24
|
-
background-color: cyan;
|
25
|
-
transition: 4000ms linear;
|
26
|
-
border: 3px solid lightgreen;
|
27
|
-
}
|
28
|
-
|
29
|
-
label {
|
30
|
-
font-size: 42px;
|
31
|
-
font-weight: 800;
|
32
|
-
color: steelblue;
|
33
|
-
}
|
34
|
-
|
35
|
-
button:hover label {
|
36
|
-
color: blue;
|
37
|
-
}
|
38
|
-
|
39
|
-
button:active {
|
40
|
-
background-color: green;
|
41
|
-
}
|
42
|
-
|
43
|
-
button:active label {
|
44
|
-
color: white;
|
45
|
-
}
|
46
|
-
|
47
|
-
#yellow_background {
|
48
|
-
background: yellow;
|
49
|
-
}
|
50
|
-
|
51
|
-
#lightgreen_background {
|
52
|
-
background: lightgreen;
|
53
|
-
}
|
54
|
-
|
55
|
-
#combo_box_text1 {
|
56
|
-
border: 10px solid steelblue;
|
57
|
-
}
|
58
|
-
|
59
|
-
GtkCheckButton {
|
60
|
-
-gtk-icon-source: -gtk-scaled(
|
61
|
-
url('checkbox-unchecked.jpg'),
|
62
|
-
url('checkbox-unchecked@2.jpg')
|
63
|
-
);
|
64
|
-
}
|
65
|
-
|
66
|
-
label#foo-bar {
|
67
|
-
font: 120px Sans;
|
68
|
-
}
|
69
|
-
|
70
|
-
/*
|
71
|
-
* This will make a text-shadow.
|
72
|
-
*/
|
73
|
-
#fancy_text_shadow {
|
74
|
-
text-shadow: 5px 5px 5px royalblue;
|
75
|
-
border-radius: 5px;
|
76
|
-
box-shadow: 0px 0px 5px black;
|
77
|
-
}
|
78
|
-
|
79
|
-
image {
|
80
|
-
border: 40px solid black;
|
81
|
-
border-radius: 50%
|
82
|
-
}
|
83
|
-
|
84
|
-
image:hover {
|
85
|
-
transition: 1s linear;
|
86
|
-
background-color: #00ff00
|
87
|
-
}
|
88
|
-
|
89
|
-
#vbox1 {
|
90
|
-
background-image: none;
|
91
|
-
padding: 10px;
|
92
|
-
border: 3px solid steelblue;
|
93
|
-
}
|
94
|
-
|
95
|
-
#vbox1:hover {
|
96
|
-
background-image: none;
|
97
|
-
border: 3px solid royalblue;
|
98
|
-
background-color: blue;
|
99
|
-
}
|
100
|
-
|
101
|
-
entry:hover {
|
102
|
-
background-color: tomato;
|
103
|
-
}
|
104
|
-
|
105
|
-
#transparent1 {
|
106
|
-
box-shadow: 0 0 0 5px rgba(0, 20, 0, 0.23), 0 0 25px 50px transparent;
|
107
|
-
}
|
108
|
-
|
109
|
-
frame {
|
110
|
-
border: 5px solid #0000ff;
|
111
|
-
border-radius: 25px;
|
112
|
-
color: #ff0000;
|
113
|
-
background-color: #606060;
|
114
|
-
}
|
115
|
-
|
116
|
-
/* Style for a custom Gtk.Box */
|
117
|
-
#custom_box {
|
118
|
-
border: 2px solid #ffffff;
|
119
|
-
border-radius: 10px;
|
120
|
-
background-color: #000000;
|
121
|
-
padding: 0px;
|
122
|
-
margin: 10px;
|
123
|
-
color: #ffffff;
|
124
|
-
opacity: 0.8;
|
125
|
-
}
|
126
|
-
|
127
|
-
/* Style for Gtk.label in Gtk.Box */
|
128
|
-
box > label {
|
129
|
-
color: #00ff00;
|
130
|
-
margin: 5px;
|
131
|
-
}
|
132
|
-
|
133
|
-
scale {
|
134
|
-
/* top | right | bottom | left */
|
135
|
-
margin: 15px;
|
136
|
-
}
|
137
|
-
|
138
|
-
progressbar {
|
139
|
-
/* top | right | bottom | left */
|
140
|
-
margin: 20px;
|
141
|
-
}
|
142
|
-
|
143
|
-
/* Prograss */
|
144
|
-
progressbar > trough > progress {
|
145
|
-
min-height: 10px;
|
146
|
-
background-color: #00ffff;
|
147
|
-
}
|
148
|
-
|
149
|
-
/* Style for Gtk.Paned Separator */
|
150
|
-
paned > separator {
|
151
|
-
background-image: linear-gradient(to bottom, #00ffff, #00ffff);
|
152
|
-
background-size: 2px 2px;
|
153
|
-
}
|
154
|
-
|
155
|
-
textview.view {
|
156
|
-
margin: 10px;
|
157
|
-
padding: 10px;
|
158
|
-
border: 2px solid rgba(0, 255, 255, 0.3);
|
159
|
-
}
|
160
|
-
|
161
|
-
grid {
|
162
|
-
margin: 10px;
|
163
|
-
}
|
164
|
-
|
165
|
-
grid > label {
|
166
|
-
font-size: 12pt;
|
167
|
-
}
|
168
|
-
|
169
|
-
EOF
|
170
|
-
|
171
|
-
# =========================================================================== #
|
172
|
-
# === WIDTH
|
173
|
-
# =========================================================================== #
|
174
|
-
WIDTH = 1400
|
175
|
-
|
176
|
-
application = Gtk::Application.new
|
177
|
-
application.signal_connect(:activate) {
|
178
|
-
# ========================================================================= #
|
179
|
-
# We have to pass the CSS into Gtk::CssProvider. We will pass the
|
180
|
-
# above-defined constant to this.
|
181
|
-
# ========================================================================= #
|
182
|
-
provider = Gtk::CssProvider.new
|
183
|
-
provider.load(data: USE_THIS_AS_THE_CSS_STRING)
|
184
|
-
Gtk::StyleContext.add_provider_for_screen(
|
185
|
-
Gdk::Screen.default,
|
186
|
-
provider,
|
187
|
-
Gtk::StyleProvider::PRIORITY_APPLICATION
|
188
|
-
)
|
189
|
-
|
190
|
-
window = Gtk::ApplicationWindow.new(application)
|
191
|
-
window.set_size_request(WIDTH, 800)
|
192
|
-
|
193
|
-
button_example = Gtk::Button.new(label: 'Button')
|
194
|
-
button_example.set_size_request(100, -1)
|
195
|
-
button_example.signal_connect(:clicked) { puts 'Hello!' }
|
196
|
-
|
197
|
-
check_button = Gtk::CheckButton.new
|
198
|
-
|
199
|
-
entry_example1 = Gtk::Entry.new
|
200
|
-
entry_example1.set_name('lightgreen_background')
|
201
|
-
entry_example2 = Gtk::Entry.new
|
202
|
-
entry_example2.set_name('yellow_background')
|
203
|
-
|
204
|
-
fixed = Gtk::Fixed.new
|
205
|
-
fixed.put(button_example, 50, 10)
|
206
|
-
fixed.put(entry_example1, 250, 120)
|
207
|
-
fixed.put(entry_example2, 250, 180)
|
208
|
-
fixed.put(check_button, 250, 280)
|
209
|
-
label_test = Gtk::Label.new('Test!')
|
210
|
-
label_test.set_name('foo-bar')
|
211
|
-
fixed.put(label_test, 250, 320)
|
212
|
-
image = Gtk::Image.new(
|
213
|
-
file: '/home/x/programming/ruby/src/'\
|
214
|
-
'gtk_paradise/lib/gtk_paradise/images/misc/'\
|
215
|
-
'sample_image.png'
|
216
|
-
)
|
217
|
-
fixed.put(image, 160, 230)
|
218
|
-
label1 = Gtk::Label.new('Fancy Text Shadow')
|
219
|
-
label1.set_name('fancy_text_shadow')
|
220
|
-
fixed.put(label1, 250, 480)
|
221
|
-
|
222
|
-
vbox2 = Gtk::Box.new(:vertical)
|
223
|
-
vbox2.set_name('vbox2')
|
224
|
-
combo_box_text1 = Gtk::ComboBoxText.new
|
225
|
-
['one','two','three'].each {|entry|
|
226
|
-
combo_box_text1.append_text(entry)
|
227
|
-
}
|
228
|
-
|
229
|
-
combo_box_text1.set_name('combo_box_text1')
|
230
|
-
vbox2.add(combo_box_text1)
|
231
|
-
vbox2.set_name('transparent1')
|
232
|
-
|
233
|
-
fixed.put(vbox2, 250, 780)
|
234
|
-
vbox1 = Gtk::Box.new(:vertical)
|
235
|
-
vbox1.set_name('vbox1')
|
236
|
-
vbox1.add(Gtk::Label.new('Hey there!'))
|
237
|
-
vbox1.set_name('transparent1')
|
238
|
-
fixed.put(vbox1, 550, 780)
|
239
|
-
frame1 = Gtk::Frame.new
|
240
|
-
button3 = Gtk::Button.new(label: "This is button3\nin a frame using CSS")
|
241
|
-
button3.signal_connect(:clicked) { e 'button3 was clicked' }
|
242
|
-
frame1.add(button3)
|
243
|
-
fixed.put(frame1, 880, 750)
|
244
|
-
custom_box = Gtk::Box.new(:vertical)
|
245
|
-
custom_box.set_name('custom_box')
|
246
|
-
custom_box.add(
|
247
|
-
Gtk::Label.new('This is #custom_box')
|
248
|
-
)
|
249
|
-
fixed.put(custom_box, 880, 450)
|
250
|
-
text_view = Gtk::TextView.new
|
251
|
-
text_view.buffer.set_text(' Hello world!')
|
252
|
-
fixed.put(
|
253
|
-
text_view, 880, 220
|
254
|
-
)
|
255
|
-
scrolled_window = Gtk::ScrolledWindow.new
|
256
|
-
scrolled_window.add(fixed)
|
257
|
-
window << scrolled_window
|
258
|
-
window.show_all
|
259
|
-
window.move(0, 0)
|
260
|
-
}
|
261
|
-
application.run
|