gtk_paradise 0.9.120 → 0.12.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15184 -5758
- data/bin/genity +26 -0
- data/bin/gtk_editor +7 -0
- data/doc/README.gen +15128 -5736
- data/doc/todo/TODO_FOR_THE_GTK_EDITOR.md +16 -0
- data/doc/todo/TODO_FOR_THE_GTK_PARADISE_PROJECT.md +300 -221
- data/doc/todo/recurring_todo_tasks.md +4 -3
- data/gtk_paradise.gemspec +28 -17
- data/lib/gtk_paradise/app/app.rb +82 -51
- data/lib/gtk_paradise/app/{app_module.rb → app_module/app_module.rb} +1149 -921
- data/lib/gtk_paradise/base_module/base_module.rb +6992 -33
- data/lib/gtk_paradise/base_module/class_methods/class_methods.rb +0 -0
- data/lib/gtk_paradise/base_module/colours.rb +52 -8
- data/lib/gtk_paradise/base_module/css.rb +327 -238
- 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 +171 -0
- data/lib/gtk_paradise/base_module/widgets/widgets.rb +69 -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 +237 -7
- data/lib/gtk_paradise/css_files/borders.css +81 -0
- data/lib/gtk_paradise/css_files/colours.css +332 -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 +152 -188
- data/lib/gtk_paradise/drawing/README.md +3 -0
- data/lib/gtk_paradise/drawing/drawing.rb +68 -0
- data/lib/gtk_paradise/drawing/event.rb +73 -0
- 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 +2 -14
- 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 +204 -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 +161 -0
- data/lib/gtk_paradise/examples/advanced/028_widgets_described_in_a_yaml_file.rb +240 -0
- data/lib/gtk_paradise/examples/advanced/029_entry_completion_example.rb +141 -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/gir_ffi/advanced/001_advanced_treeview_example.rb +75 -0
- data/lib/gtk_paradise/examples/gir_ffi/advanced/README.md +2 -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} +31 -1
- 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} +12 -4
- 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/{020_radio_button_window.rb → 038_radio_button_window.rb} +9 -9
- 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 +84 -0
- data/lib/gtk_paradise/examples/gtk3/{035_notebook_css_example.rb → 052_notebook_css_example.rb} +3 -2
- 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} +13 -2
- 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} +21 -3
- 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/{065_tooltips_example.rb → 079_tooltips_example.rb} +14 -5
- 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} +15 -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/027_menubar_example.rb +35 -0
- data/lib/gtk_paradise/examples/gtk4/030_notebook_example.rb +83 -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/gtk4/103_drawing_example.rb +101 -0
- data/lib/gtk_paradise/examples/gtk4/104_quit_on_keypress_event.rb +64 -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 +131 -277
- data/lib/gtk_paradise/gtk_classes/button.rb +61 -40
- 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 +48 -12
- data/lib/gtk_paradise/gtk_classes/combo_box.rb +22 -15
- data/lib/gtk_paradise/gtk_classes/combo_box_entry.rb +17 -11
- data/lib/gtk_paradise/gtk_classes/combo_box_text.rb +30 -25
- data/lib/gtk_paradise/gtk_classes/dialog.rb +2 -2
- data/lib/gtk_paradise/gtk_classes/entry.rb +281 -126
- data/lib/gtk_paradise/gtk_classes/entry_completion.rb +15 -8
- 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 +25 -5
- data/lib/gtk_paradise/gtk_classes/grid.rb +343 -153
- data/lib/gtk_paradise/gtk_classes/hbox.rb +145 -0
- data/lib/gtk_paradise/gtk_classes/header_bar.rb +20 -8
- data/lib/gtk_paradise/gtk_classes/image.rb +5 -3
- data/lib/gtk_paradise/gtk_classes/label.rb +201 -145
- data/lib/gtk_paradise/gtk_classes/list_store.rb +13 -0
- 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 +173 -72
- data/lib/gtk_paradise/gtk_classes/paned.rb +52 -0
- data/lib/gtk_paradise/gtk_classes/radio_menu_item.rb +26 -1
- data/lib/gtk_paradise/gtk_classes/scale_button.rb +16 -1
- data/lib/gtk_paradise/gtk_classes/scrolled_window.rb +16 -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 +35 -13
- 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 +52 -19
- data/lib/gtk_paradise/gtk_classes/text_view.rb +54 -11
- 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 +101 -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 +1158 -646
- 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/internal/gtk_tree_view1.png +0 -0
- data/lib/gtk_paradise/images/misc/minus_symbol.png +0 -0
- data/lib/gtk_paradise/images/misc/plus_symbol.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 +9 -17
- data/lib/gtk_paradise/prototypes/unified_gtk_prototype.rb +179 -0
- data/lib/gtk_paradise/require_gir_ffi_gtk3.rb +3 -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 +26 -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} +810 -258
- 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 +4 -8
- 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 +19 -30
- 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 +58 -336
- 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 +34 -39
- data/lib/gtk_paradise/widgets/gtk3/editor/create.rb +67 -42
- data/lib/gtk_paradise/widgets/gtk3/editor/editor.rb +257 -274
- data/lib/gtk_paradise/widgets/gtk3/editor/internal_widgets/goto_line_widget.rb +53 -69
- data/lib/gtk_paradise/widgets/gtk3/editor/misc.rb +359 -112
- 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 +9 -26
- 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/gtk3/four_components_entry/four_components_entry.rb +353 -0
- 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/keyboard/keyboard.rb +378 -0
- data/lib/gtk_paradise/widgets/gtk3/linux_users/linux_users.rb +35 -38
- 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 +325 -7
- data/lib/gtk_paradise/widgets/gtk3/notebook_tab_with_icon/notebook_tab_with_icon.rb +469 -7
- data/lib/gtk_paradise/widgets/gtk3/notebook_with_storage_functionality/notebook_with_storage_functionality.rb +180 -0
- data/lib/gtk_paradise/widgets/gtk3/numbered_lines/numbered_lines.rb +241 -107
- 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 +363 -47
- 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 +3 -7
- data/lib/gtk_paradise/widgets/gtk3/tabble/tabble.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk3/type_trainer/type_trainer.rb +182 -0
- data/lib/gtk_paradise/widgets/gtk3/view_webpage/view_webpage.rb +2 -6
- data/lib/gtk_paradise/widgets/gtk3/widget_switcher/widget_switcher.rb +240 -0
- data/lib/gtk_paradise/widgets/gtk3/wiki/README.md +4 -0
- data/lib/gtk_paradise/widgets/gtk3/wiki/wiki.rb +445 -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/sys_message/sys_message.rb → gtk4/xpm_loader/xpm_loader.rb} +13 -10
- data/lib/gtk_paradise/widgets/shared_code/browser/browser_module.rb +4 -16
- data/lib/gtk_paradise/widgets/shared_code/calculator/calculator_module.rb +581 -0
- 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/file_viewer/file_viewer_module.rb +3 -3
- 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/maximize_button/maximize_button_module.rb +2 -7
- data/lib/gtk_paradise/widgets/shared_code/mini_clock/mini_clock_module.rb +133 -76
- 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 +59 -46
- 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 +1 -1
- 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_numbered_lines.rb +36 -0
- data/test/misc/testing_the_gtk_classes.rb +83 -0
- metadata +266 -198
- 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/stopwatch/stopwatch.rb +0 -30
- data/lib/gtk_paradise/widgets/gtk2/sys_message/sys_message.config +0 -6
- 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/{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/{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
@@ -0,0 +1,88 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# === Gtk::SearchBarExample
|
6
|
+
#
|
7
|
+
# This shows how to use the modern search-bar. This also currently does
|
8
|
+
# not work; it works in ruby-gtk3 though.
|
9
|
+
# =========================================================================== #
|
10
|
+
# require 'gtk_paradise/examples/gtk4/008_search_bar_example.rb'
|
11
|
+
# Gtk::SearchBarExample.new
|
12
|
+
# =========================================================================== #
|
13
|
+
# $GTK_PARADISE/examples/gtk4/008_search_bar_example.rb
|
14
|
+
# =========================================================================== #
|
15
|
+
require 'gtk4'
|
16
|
+
|
17
|
+
module Gtk
|
18
|
+
|
19
|
+
class SearchBarExample < ::Gtk::Box
|
20
|
+
|
21
|
+
# ========================================================================= #
|
22
|
+
# === initialize
|
23
|
+
# ========================================================================= #
|
24
|
+
def initialize
|
25
|
+
super(:horizontal)
|
26
|
+
reset
|
27
|
+
run
|
28
|
+
end
|
29
|
+
|
30
|
+
# ========================================================================= #
|
31
|
+
# === searchbar?
|
32
|
+
# ========================================================================= #
|
33
|
+
def searchbar?
|
34
|
+
@searchbar
|
35
|
+
end
|
36
|
+
|
37
|
+
# ========================================================================= #
|
38
|
+
# === reset
|
39
|
+
# ========================================================================= #
|
40
|
+
def reset
|
41
|
+
@searchbar = ::Gtk::SearchBar.new
|
42
|
+
end
|
43
|
+
|
44
|
+
# ========================================================================= #
|
45
|
+
# === on_key_event
|
46
|
+
#
|
47
|
+
# Cause the searchbar to show up.
|
48
|
+
# ========================================================================= #
|
49
|
+
def on_key_event(widget, event)
|
50
|
+
shortcut = ::Gtk.accelerator_get_label(event.keyval, event.state)
|
51
|
+
# ======================================================================= #
|
52
|
+
# Get support for Ctrl+F next:
|
53
|
+
# ======================================================================= #
|
54
|
+
if ['Ctrl+F', 'Ctrl+Mod2+F'].include? shortcut
|
55
|
+
if @searchbar.search_mode?
|
56
|
+
@searchbar.set_search_mode(false)
|
57
|
+
else
|
58
|
+
@searchbar.set_search_mode(true)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# ========================================================================= #
|
64
|
+
# === run
|
65
|
+
# ========================================================================= #
|
66
|
+
def run
|
67
|
+
label = ::Gtk::Label.new('Press Control+F to initiate find')
|
68
|
+
grid = ::Gtk::Grid.new
|
69
|
+
grid.attach(label, 0, 0, 1, 1)
|
70
|
+
grid.attach(@searchbar, 0, 1, 1, 1)
|
71
|
+
|
72
|
+
@searchentry = ::Gtk::SearchEntry.new
|
73
|
+
@searchbar.connect_entry(@searchentry)
|
74
|
+
@searchbar.set_child(@searchentry)
|
75
|
+
append(grid)
|
76
|
+
end
|
77
|
+
|
78
|
+
end; end
|
79
|
+
|
80
|
+
application = Gtk::Application.new('org.gtk.search_bar_example', :flags_none)
|
81
|
+
application.signal_connect(:activate) { |app|
|
82
|
+
win = ::Gtk::ApplicationWindow.new(app)
|
83
|
+
win.title = 'Search Bar Example'
|
84
|
+
win.set_default_size(800, 800)
|
85
|
+
win.set_child(Gtk::SearchBarExample.new)
|
86
|
+
win.show
|
87
|
+
}
|
88
|
+
application.run
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# $GTK_PARADISE/examples/gtk4/009_text_view_example.rb
|
6
|
+
# =========================================================================== #
|
7
|
+
require 'gtk4'
|
8
|
+
|
9
|
+
application = Gtk::Application.new('org.gtk.text_view_example', :flags_none)
|
10
|
+
|
11
|
+
application.signal_connect(:activate) { |app|
|
12
|
+
win = Gtk::ApplicationWindow.new(app)
|
13
|
+
win.title = 'Text View Example'
|
14
|
+
win.set_default_size(120, 600)
|
15
|
+
text_buffer = Gtk::TextBuffer.new
|
16
|
+
text_buffer.set_text(
|
17
|
+
"Hello world!\n" * 80
|
18
|
+
)
|
19
|
+
text_view = Gtk::TextView.new(text_buffer)
|
20
|
+
text_view.set_size_request(1200, 1000)
|
21
|
+
|
22
|
+
scrolled_window = Gtk::ScrolledWindow.new()
|
23
|
+
scrolled_window.set_child(text_view)
|
24
|
+
|
25
|
+
win.set_child(scrolled_window)
|
26
|
+
win.show
|
27
|
+
win.set_size_request(1200, 800)
|
28
|
+
}
|
29
|
+
|
30
|
+
application.run
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# $GTK_PARADISE/examples/gtk4/010_switch_example.rb
|
6
|
+
# =========================================================================== #
|
7
|
+
require 'gtk4'
|
8
|
+
|
9
|
+
application = Gtk::Application.new('org.gtk.switch_example', :flags_none)
|
10
|
+
|
11
|
+
def on_switch_activated(switch)
|
12
|
+
state = switch.active? ? 'on' : 'off'
|
13
|
+
puts "Switch was turned #{state}"
|
14
|
+
end
|
15
|
+
|
16
|
+
application.signal_connect(:activate) { |app|
|
17
|
+
win = Gtk::ApplicationWindow.new(app)
|
18
|
+
win.title = 'Switch Widgets'
|
19
|
+
win.set_default_size(120, 600)
|
20
|
+
|
21
|
+
vbox = Gtk::Box.new(:vertical)
|
22
|
+
vbox.prepend(
|
23
|
+
switch1 = Gtk::Switch.new
|
24
|
+
)
|
25
|
+
vbox.prepend(
|
26
|
+
switch2 = Gtk::Switch.new
|
27
|
+
)
|
28
|
+
vbox.prepend(
|
29
|
+
switch3 = Gtk::Switch.new
|
30
|
+
)
|
31
|
+
|
32
|
+
array_switches = []
|
33
|
+
array_switches << switch1
|
34
|
+
array_switches << switch2
|
35
|
+
array_switches << switch3
|
36
|
+
|
37
|
+
array_switches.each {|switch|
|
38
|
+
switch.signal_connect('notify::active') { |entry|
|
39
|
+
on_switch_activated(entry)
|
40
|
+
}
|
41
|
+
}
|
42
|
+
array_switches.each {|switch|
|
43
|
+
switch.set_hexpand(false)
|
44
|
+
switch.set_vexpand(false)
|
45
|
+
switch.set_size_request(42, 18)
|
46
|
+
}
|
47
|
+
win.set_child(vbox)
|
48
|
+
win.show
|
49
|
+
win.set_size_request(200, 800)
|
50
|
+
}
|
51
|
+
|
52
|
+
application.run
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Original example by Sami Sieranoja:
|
2
|
+
#
|
3
|
+
# https://raw.githubusercontent.com/ruby-gnome/ruby-gnome/b65be1a44474dce55f89fe723a73b34dde676a05/gtk4/sample/examples/menubar.rb
|
4
|
+
#
|
5
|
+
require 'gtk4'
|
6
|
+
|
7
|
+
app = Gtk::Application.new('org.gtk.example', :flags_none)
|
8
|
+
|
9
|
+
app.signal_connect(:activate) {
|
10
|
+
window = Gtk::ApplicationWindow.new(app)
|
11
|
+
window.set_application(app)
|
12
|
+
|
13
|
+
act_quit = Gio::SimpleAction.new('quit')
|
14
|
+
app.add_action(act_quit)
|
15
|
+
act_quit.signal_connect(:activate) { |_simple_action, _parameter|
|
16
|
+
window.destroy
|
17
|
+
exit!
|
18
|
+
}
|
19
|
+
|
20
|
+
menubar = Gio::Menu.new()
|
21
|
+
menu_item_menu = Gio::MenuItem.new('Menu', nil)
|
22
|
+
menu = Gio::Menu.new()
|
23
|
+
menu_item_quit = Gio::MenuItem.new('Quit', 'app.quit')
|
24
|
+
menu.append_item(menu_item_quit)
|
25
|
+
menu_item_menu.set_submenu(menu)
|
26
|
+
menubar.append_item(menu_item_menu)
|
27
|
+
app.menubar = menubar
|
28
|
+
window.set_show_menubar true
|
29
|
+
|
30
|
+
window.show
|
31
|
+
}
|
32
|
+
|
33
|
+
if __FILE__ == $PROGRAM_NAME
|
34
|
+
app.run
|
35
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# $GTK_PARADISE/examples/gtk4/030_notebook_example.rb
|
6
|
+
# =========================================================================== #
|
7
|
+
require 'gtk4'
|
8
|
+
|
9
|
+
alias e puts
|
10
|
+
|
11
|
+
module Gtk
|
12
|
+
|
13
|
+
class NotebookExample < ::Gtk::Box # === Gtk::NotebookExample
|
14
|
+
|
15
|
+
# ========================================================================= #
|
16
|
+
# === initialize
|
17
|
+
# ========================================================================= #
|
18
|
+
def initialize(
|
19
|
+
run_already = true
|
20
|
+
)
|
21
|
+
super(:horizontal)
|
22
|
+
reset
|
23
|
+
run if run_already
|
24
|
+
end
|
25
|
+
|
26
|
+
# ========================================================================= #
|
27
|
+
# === title?
|
28
|
+
# ========================================================================= #
|
29
|
+
def title?
|
30
|
+
'Cahnged Events Example'
|
31
|
+
end; alias title title? # === title
|
32
|
+
|
33
|
+
# ========================================================================= #
|
34
|
+
# === reset (reset tag)
|
35
|
+
# ========================================================================= #
|
36
|
+
def reset
|
37
|
+
# ======================================================================= #
|
38
|
+
# === @notebook
|
39
|
+
# ======================================================================= #
|
40
|
+
@notebook = ::Gtk::Notebook.new
|
41
|
+
@notebook.set_show_tabs(true)
|
42
|
+
@notebook.set_show_border(true)
|
43
|
+
@notebook.set_scrollable(true)
|
44
|
+
@notebook.set_tab_pos(:right) # This is just to demonstrate how this is done.
|
45
|
+
end
|
46
|
+
|
47
|
+
# ========================================================================= #
|
48
|
+
# === run
|
49
|
+
# ========================================================================= #
|
50
|
+
def run
|
51
|
+
@notebook.append_page(Gtk::Label.new('#1'), Gtk::Button.new('OK'))
|
52
|
+
@notebook.append_page(Gtk::Label.new('#2'), Gtk::Button.new('OK'))
|
53
|
+
@notebook.page = 0
|
54
|
+
@notebook.signal_connect(:switch_page) {|widget, event|
|
55
|
+
puts 'page is switch'
|
56
|
+
pp @notebook.page
|
57
|
+
true
|
58
|
+
}
|
59
|
+
pp @notebook.pages
|
60
|
+
append(@notebook)
|
61
|
+
end
|
62
|
+
|
63
|
+
end; end
|
64
|
+
|
65
|
+
Gtk::Settings.default.gtk_font_name = 'Sans 22'
|
66
|
+
|
67
|
+
if __FILE__ == $PROGRAM_NAME
|
68
|
+
alias e puts
|
69
|
+
application = Gtk::Application.new('org.gtk.changed_events_example', :flags_none)
|
70
|
+
application.signal_connect(:activate) { |app|
|
71
|
+
win = Gtk::ApplicationWindow.new(app)
|
72
|
+
win.title = 'Showcasing Events'
|
73
|
+
win.set_default_size(600, 200)
|
74
|
+
win.set_child(Gtk::NotebookExample.new)
|
75
|
+
win.signal_connect(:close_request) {
|
76
|
+
e 'Exiting now.'
|
77
|
+
Gtk.main_quit
|
78
|
+
}
|
79
|
+
window.signal_connect(:delete_event) { Gtk.main_quit }
|
80
|
+
win.show
|
81
|
+
}
|
82
|
+
application.run
|
83
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# $GTK_PARADISE/examples/gtk4/074_frame_example.rb
|
6
|
+
# =========================================================================== #
|
7
|
+
require 'gtk4'
|
8
|
+
|
9
|
+
# =========================================================================== #
|
10
|
+
# === SWITCH_TEXT
|
11
|
+
# =========================================================================== #
|
12
|
+
SWITCH_TEXT = 'switch here to (will use .reparent)'
|
13
|
+
|
14
|
+
# =========================================================================== #
|
15
|
+
# Use a specific font size next:
|
16
|
+
# =========================================================================== #
|
17
|
+
#::Gtk::Settings.default.gtk_font_name = 'Mono 22'
|
18
|
+
|
19
|
+
@box1 = Gtk::Box.new(:vertical, 0)
|
20
|
+
|
21
|
+
box2 = Gtk::Box.new(:horizontal, 5)
|
22
|
+
@box1.append(box2)
|
23
|
+
|
24
|
+
label = Gtk::Label.new('Hello World')
|
25
|
+
frame1 = Gtk::Frame.new('Frame 1')
|
26
|
+
box2.append(frame1)
|
27
|
+
|
28
|
+
@box3 = Gtk::Box.new(:vertical, 5)
|
29
|
+
frame1.set_child(@box3)
|
30
|
+
|
31
|
+
button = Gtk::Button.new(label: SWITCH_TEXT)
|
32
|
+
button.signal_connect(:clicked) { label.reparent(@box3) } # Do reparenting here.
|
33
|
+
@box3.append(button)
|
34
|
+
@box3.append(label)
|
35
|
+
|
36
|
+
frame2 = Gtk::Frame.new('Frame 2')
|
37
|
+
frame2.label_widget.set_selectable(true)
|
38
|
+
box2.append(frame2)
|
39
|
+
|
40
|
+
box4 = Gtk::Box.new(:vertical, 5)
|
41
|
+
frame2.set_child(box4)
|
42
|
+
|
43
|
+
button = Gtk::Button.new(label: SWITCH_TEXT)
|
44
|
+
button.signal_connect(:clicked) { label.reparent(box4) } # Do reparenting here.
|
45
|
+
box4.append(button)
|
46
|
+
|
47
|
+
separator = Gtk::Separator.new(:horizontal)
|
48
|
+
@box1.append(separator)
|
49
|
+
|
50
|
+
box2 = Gtk::Box.new(:horizontal, 10)
|
51
|
+
@box1.append(box2)
|
52
|
+
|
53
|
+
# =========================================================================== #
|
54
|
+
# Add the clost-button next.
|
55
|
+
# =========================================================================== #
|
56
|
+
button_close = Gtk::Button.new(label: 'close')
|
57
|
+
button_close.signal_connect(:clicked) { Gtk.main_quit }
|
58
|
+
box2.append(button_close)
|
59
|
+
box2.append(Gtk::Label.new('Also showing some button styles'))
|
60
|
+
|
61
|
+
@box3 = Gtk::Box.new(:vertical)
|
62
|
+
frame1 = Gtk::Frame.new
|
63
|
+
#frame1.shadow_type = Gtk::ShadowType::IN
|
64
|
+
label1 = Gtk::Label.new('Frame 1: Shadow type in')
|
65
|
+
frame1.set_child(label1)
|
66
|
+
@box3.append(frame1)
|
67
|
+
|
68
|
+
frame2 = Gtk::Frame.new
|
69
|
+
#frame2.shadow_type = Gtk::ShadowType::OUT
|
70
|
+
label2 = Gtk::Label.new('Frame 2: Shadow type out')
|
71
|
+
frame2.set_child(label2)
|
72
|
+
@box3.append(frame2)
|
73
|
+
|
74
|
+
frame3 = Gtk::Frame.new
|
75
|
+
#frame3.shadow_type = Gtk::ShadowType::ETCHED_IN
|
76
|
+
|
77
|
+
label3 = Gtk::Label.new('Frame 3: Shadow etched in')
|
78
|
+
frame3.set_child(label3)
|
79
|
+
@box3.append(frame3)
|
80
|
+
|
81
|
+
frame4 = Gtk::Frame.new
|
82
|
+
#frame4.shadow_type = Gtk::ShadowType::ETCHED_OUT
|
83
|
+
label4 = Gtk::Label.new('Frame 4: Shadow etched out')
|
84
|
+
frame4.set_child(label4)
|
85
|
+
@box3.append(frame4)
|
86
|
+
|
87
|
+
class MixedBox < Gtk::Box
|
88
|
+
|
89
|
+
def initialize(box1, box2)
|
90
|
+
super(:vertical)
|
91
|
+
append(box1)
|
92
|
+
append(box2)
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
application = Gtk::Application.new('org.gtk.frame_example', :flags_none)
|
98
|
+
application.signal_connect(:activate) { |app|
|
99
|
+
win = ::Gtk::ApplicationWindow.new(app)
|
100
|
+
win.title = 'Showcasing Frame Example'
|
101
|
+
win.set_default_size(100, 100)
|
102
|
+
win.set_child(MixedBox.new(@box1, @box3))
|
103
|
+
win.show
|
104
|
+
}
|
105
|
+
application.run
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# This simply shows ten gtk-label entries in a vertical box.
|
6
|
+
# =========================================================================== #
|
7
|
+
# $GTK_PARADISE/examples/gtk4/=76_ten_vboxes_example.rb
|
8
|
+
# =========================================================================== #
|
9
|
+
require 'gtk4'
|
10
|
+
|
11
|
+
::Gtk::Settings.default.gtk_font_name = 'Mono 25'
|
12
|
+
|
13
|
+
vbox = Gtk::Box.new(:vertical)
|
14
|
+
|
15
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new(' 1')))
|
16
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new(' 2')))
|
17
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new(' 3')))
|
18
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new(' 4')))
|
19
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new(' 5')))
|
20
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new(' 6')))
|
21
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new(' 7')))
|
22
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new(' 8')))
|
23
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new(' 9')))
|
24
|
+
vbox.append(Gtk::Box.new(:horizontal).add(Gtk::Label.new('10')))
|
25
|
+
vbox.show
|
26
|
+
|
27
|
+
application = Gtk::Application.new('org.gtk.ten_vboxes_example', :flags_none)
|
28
|
+
application.signal_connect(:activate) { |app|
|
29
|
+
win = ::Gtk::ApplicationWindow.new(app)
|
30
|
+
win.title = 'Showcasing Ten vboxes'
|
31
|
+
win.set_default_size(100, 100)
|
32
|
+
win.set_child(vbox)
|
33
|
+
win.show
|
34
|
+
}
|
35
|
+
application.run
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
require 'gtk4'
|
6
|
+
|
7
|
+
module Gtk
|
8
|
+
|
9
|
+
class CalendarExample < ::Gtk::Box
|
10
|
+
|
11
|
+
::Gtk::Settings.default.gtk_font_name = 'Sans 25'
|
12
|
+
|
13
|
+
# ========================================================================= #
|
14
|
+
# === initialize
|
15
|
+
# ========================================================================= #
|
16
|
+
def initialize
|
17
|
+
super(:horizontal)
|
18
|
+
reset
|
19
|
+
calendar = ::Gtk::Calendar.new
|
20
|
+
# .select_month() has been deprecated.
|
21
|
+
#calendar.select_month(@date.month, @date.year)
|
22
|
+
# calendar.select_day(GLib::DateTime.now)
|
23
|
+
# calendar.mark_day(GLib::DateTime.now)
|
24
|
+
append(calendar)
|
25
|
+
end
|
26
|
+
|
27
|
+
# ========================================================================= #
|
28
|
+
# === reset
|
29
|
+
# ========================================================================= #
|
30
|
+
def reset
|
31
|
+
end
|
32
|
+
|
33
|
+
end; end
|
34
|
+
|
35
|
+
if __FILE__ == $PROGRAM_NAME
|
36
|
+
|
37
|
+
application = Gtk::Application.new('org.gtk.calendar_example', :flags_none)
|
38
|
+
application.signal_connect(:activate) { |app|
|
39
|
+
win = ::Gtk::ApplicationWindow.new(app)
|
40
|
+
win.title = 'Showcasing Ten vboxes'
|
41
|
+
win.set_default_size(100, 100)
|
42
|
+
win.set_child(Gtk::CalendarExample.new)
|
43
|
+
win.show
|
44
|
+
}
|
45
|
+
application.run
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
require 'gtk4'
|
6
|
+
|
7
|
+
module Gtk
|
8
|
+
|
9
|
+
class ChangedEventsExample < ::Gtk::Box # === Gtk::ChangedEventsExample
|
10
|
+
|
11
|
+
# ========================================================================= #
|
12
|
+
# === initialize
|
13
|
+
# ========================================================================= #
|
14
|
+
def initialize(
|
15
|
+
run_already = true
|
16
|
+
)
|
17
|
+
super(:horizontal)
|
18
|
+
reset
|
19
|
+
run if run_already
|
20
|
+
end
|
21
|
+
|
22
|
+
# ========================================================================= #
|
23
|
+
# === title?
|
24
|
+
# ========================================================================= #
|
25
|
+
def title?
|
26
|
+
'Cahnged Events Example'
|
27
|
+
end; alias title title? # === title
|
28
|
+
|
29
|
+
# ========================================================================= #
|
30
|
+
# === reset (reset tag)
|
31
|
+
# ========================================================================= #
|
32
|
+
def reset
|
33
|
+
# ======================================================================= #
|
34
|
+
# === @spinner
|
35
|
+
# ======================================================================= #
|
36
|
+
@spinner = ::Gtk::Spinner.new
|
37
|
+
@spinner.set_spinning(true)
|
38
|
+
end
|
39
|
+
|
40
|
+
# ========================================================================= #
|
41
|
+
# === run
|
42
|
+
# ========================================================================= #
|
43
|
+
def run
|
44
|
+
Thread.new {
|
45
|
+
sleep 0.3 # Just to show how to activate it, via a slight delay.
|
46
|
+
@spinner.set_spinning(true)
|
47
|
+
}
|
48
|
+
append(@spinner)
|
49
|
+
|
50
|
+
text1 = Gtk::Label.new(
|
51
|
+
' This is a test. You can click on it via the mouse. '
|
52
|
+
)
|
53
|
+
click1 = Gtk::GestureClick.new
|
54
|
+
click1.signal_connect(:pressed) { e 'The mouse button was clicked.' }
|
55
|
+
text1.add_controller(click1)
|
56
|
+
append(text1)
|
57
|
+
|
58
|
+
set_halign(:center)
|
59
|
+
end
|
60
|
+
|
61
|
+
end; end
|
62
|
+
|
63
|
+
if __FILE__ == $PROGRAM_NAME
|
64
|
+
alias e puts
|
65
|
+
application = Gtk::Application.new('org.gtk.changed_events_example', :flags_none)
|
66
|
+
application.signal_connect(:activate) { |app|
|
67
|
+
win = Gtk::ApplicationWindow.new(app)
|
68
|
+
win.title = 'Showcasing Events'
|
69
|
+
win.set_default_size(600, 200)
|
70
|
+
win.set_child(Gtk::ChangedEventsExample.new)
|
71
|
+
win.signal_connect(:close_request) {
|
72
|
+
e 'Exiting now.'
|
73
|
+
}
|
74
|
+
win.show
|
75
|
+
}
|
76
|
+
application.run
|
77
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# $GTK_PARADISE/examples/gtk4/101_actionbar_example.rb
|
6
|
+
# =========================================================================== #
|
7
|
+
# Note that this example doesn't work correctly right now.
|
8
|
+
# =========================================================================== #
|
9
|
+
require 'gtk4'
|
10
|
+
|
11
|
+
application = Gtk::Application.new('org.gtk.actionbar_example', :flags_none)
|
12
|
+
|
13
|
+
def on_button_clicked
|
14
|
+
puts 'I was clicked.'
|
15
|
+
end
|
16
|
+
|
17
|
+
application.signal_connect(:activate) { |app|
|
18
|
+
win = Gtk::ApplicationWindow.new(app)
|
19
|
+
win.title = 'Actionbar Example'
|
20
|
+
win.set_default_size(1200, 600)
|
21
|
+
|
22
|
+
actionbar = Gtk::ActionBar.new
|
23
|
+
actionbar.set_valign(Gtk::Align::END)
|
24
|
+
actionbar.set_vexpand(expand = true)
|
25
|
+
# Populate the actionbar next:
|
26
|
+
|
27
|
+
icons = %w(
|
28
|
+
call-start-symbolic
|
29
|
+
call-stop-symbolic
|
30
|
+
contact-new-symbolic
|
31
|
+
address-book-new-symbolic
|
32
|
+
/home/x/data/images/NJOY/SmilingLady.jpg
|
33
|
+
)
|
34
|
+
|
35
|
+
icons.each {|icon|
|
36
|
+
if File.exist? icon
|
37
|
+
button = Gtk::Button.new
|
38
|
+
button.set_child(Gtk::Image.new(file: icon))
|
39
|
+
else
|
40
|
+
button = Gtk::Button.new(stock_id: icon)
|
41
|
+
end
|
42
|
+
button.signal_connect(:clicked) { on_button_clicked }
|
43
|
+
actionbar.pack_start(child = button)
|
44
|
+
}
|
45
|
+
|
46
|
+
vbox = Gtk::Box.new(:vertical)
|
47
|
+
vbox.prepend(
|
48
|
+
actionbar
|
49
|
+
)
|
50
|
+
win.set_child(vbox)
|
51
|
+
win.show
|
52
|
+
win.set_size_request(200, 800)
|
53
|
+
}
|
54
|
+
|
55
|
+
application.run
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# Encoding: UTF-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# =========================================================================== #
|
5
|
+
# $GTK_PARADISE/examples/gtk4/102_picture_example.rb
|
6
|
+
# =========================================================================== #
|
7
|
+
# Since as of gtk4 Gtk::Picture is a new class.
|
8
|
+
# =========================================================================== #
|
9
|
+
require 'gtk4'
|
10
|
+
|
11
|
+
application = Gtk::Application.new('org.gtk.picture_example', :flags_none)
|
12
|
+
|
13
|
+
# =========================================================================== #
|
14
|
+
# === USE_THIS_FILE
|
15
|
+
# =========================================================================== #
|
16
|
+
USE_THIS_FILE = '/home/x/data/images/NJOY/SomeD.jpg'
|
17
|
+
|
18
|
+
|
19
|
+
application.signal_connect(:activate) { |app|
|
20
|
+
win = Gtk::ApplicationWindow.new(app)
|
21
|
+
win.title = 'Actionbar Example'
|
22
|
+
win.set_default_size(1200, 600)
|
23
|
+
|
24
|
+
vbox = Gtk::Box.new(:vertical)
|
25
|
+
picture = Gtk::Picture.new
|
26
|
+
#pp picture.methods.sort
|
27
|
+
picture.filename = USE_THIS_FILE
|
28
|
+
picture.set_keep_aspect_ratio(true)
|
29
|
+
vbox.prepend(picture)
|
30
|
+
win.set_child(vbox)
|
31
|
+
win.show
|
32
|
+
win.set_size_request(800, 800)
|
33
|
+
}
|
34
|
+
|
35
|
+
application.run
|