diff --git a/README.md b/README.md index 217afba..4dd90cd 100644 --- a/README.md +++ b/README.md @@ -27,5 +27,7 @@ cargo run --all-features --bin EXAMPLE-NAME Please be sure to have installed all the required libraries before building examples (the list is available on the [gtk-rs](https://github.com/gtk-rs/gtk/) repository). +A list of examples with screenshots is available [here](reference.md). + ## LICENSE The gtk-rs examples repository is licensed under the MIT license, please refer to the LICENSE and COPYRIGHT files for more information. diff --git a/reference.md b/reference.md new file mode 100644 index 0000000..e6e5102 --- /dev/null +++ b/reference.md @@ -0,0 +1,238 @@ +# Reference + +This page list all gtk-rs examples with screenshots and a short description of +what it does. + +## accessibility + +This sample demonstrates how to make an application more accessible. + +![accessibility-screenshot](screenshots/accessibility.png) + +## basic + +This sample demonstrates how to create a toplevel `window`, set its title, size +and position, how to add a `button` to this `window` and how to connect signals +with actions. + +![basic-screenshot](screenshots/basic.png) + +## basic_subclass + +This file creates a `GtkApplication` and a `GtkApplicationWindow` subclass and +showcases how you can override virtual funcitons such as `startup` and +`activate` and how to interact with the GObjects and their private structs. + +![basic_subclass-screenshot](screenshots/basic_subclass.png) + +## builder_basics + +This sample demonstrates how to use the builder with an imported glade file. + +![builder_basics-screenshot](screenshots/builder_basics.png) + +## builder_signal + +This sample demonstrates how to handle signals in builder. + +![builder_signal-screenshot](screenshots/builder_signal.png) + +## builders + +This sample demonstrates how to create a widget using the builders. + +![builders-screenshot](screenshots/builders.png) + +## cairo_png + +This sample demonstrates how to create `ImageSurface`, draw on it and then save +result to PNG file. + +Analog of C# example http://www.mgsloan.com/cairo_tut/stroke.cs + +## cairotest + +This sample demonstrates how to create draw using cairo. + +![cairotest-screenshot](screenshots/cairotest.png) + +## cairo_threads + +This sample demonstrate how render in threads. + +![cairo_threads-screenshot](screenshots/cairo_threads.png) + +## child-properties + +This sample demonstrates how to set child properties. + +![child-properties-screenshot](screenshots/child-properties.png) + +## clipboard_simple + +This sample demonstrates how to manipulate clipboard. + +![clipboard_simple-screenshot](screenshots/clipboard_simple.png) + +## clock + +This sample demonstrates how to use `gtk::timeout_add_seconds` to run a +periodic, implementing a clock in this example. + +![clock-screenshot](screenshots/clock.png) + +## clone_macro + +This sample demonstrates how to use `gtk::clone` macros for passing variables +as strong or weak references into a closure. + +![clone_macro-screenshot](screenshots/clone_macro.png) + +## communication_thread + +Example on how to use a communication thread alongside with the GUI thread. + +![communication_thread-screenshot](screenshots/communication_thread.png) + +## css + +This sample demonstrates how to use CSS with gtk-rs. + +![css-screenshot](screenshots/css.png) + +## drag_and_drop + +This sample demonstrates how manipulate drag and drop. + +![drag_and_drop-screenshot](screenshots/drag_and_drop.png) + +## drag_and_drop_text_view + +This sample displays a list of filenames when they're dropped on the textview +widget. + +![drag_and_drop_text_view-screenshot](screenshots/drag_and_drop_text_view.png) + +## entry_completion + +This example demonstrates how to build a list of items and use them to +autocomplete a field as the user types in something. + +![entry_completion-screenshot](screenshots/entry_completion.png) + +## grid + +This sample demonstrate how to organize widgets inside grid container. + +![grid-screenshot](screenshots/grid.png) + +## gtktest + +![grid-screenshot](screenshots/grid.png) + +## iconview_example + +This sample demonstrate how to use `IconView`. + +![iconview_example-screenshot](screenshots/iconview_example.png) + +## list_store + +This sample demonstrate how to use `ListStore`. + +![list_store-screenshot](screenshots/list_store.png) + +## menu_bar + +This sample demonstrates how to use Menus/MenuBars and MenuItems in Windows. + +![menu_bar-screenshot](screenshots/menu_bar.png) + +## menu_bar_system + +This sample demonstrates how to create a "system" menu bar. + +![menu_bar_system-screenshot](screenshots/menu_bar_system.png) + +## multithreading_context + +This sample demonstrates how to use thread with `MainContext`. + +![multithreading_context-screenshot](screenshots/multithreading_context.png) + +## multi_windows + +This sample demonstrates how to use create multible windows. + +![multi_windows-screenshot](screenshots/multi_windows.png) + +## notebook + +This sample demonstrates how to use notebook-like tabs. + +![notebook-screenshot](screenshots/notebook.png) + +## overlay + +This sample demonstrates how to create an element "floating" above others. + +![overlay-screenshot](screenshots/overlay.png) + +## pango_attributes + +This sample demonstrates how to use various attributes on labels text. + +![pango_attributes-screenshot](screenshots/pango_attributes.png) + +## printing + +This sample reads text from two Entry fields, shows a print dialog and prints +both texts one below the other. + +![printing-screenshot](screenshots/printing.png) + +## progress_tracker + +Track progress with a background thread and a channel. + +![progress_tracker-screenshot](screenshots/progress_tracker.png) + +## simple_treeview + +This sample demonstrates how to create a `TreeView` with a `ListStore`. + +![simple_treeview-screenshot](screenshots/simple_treeview.png) + +## sync_widgets + +This sample demonstrates how to synchronize widgets. + +![sync_widgets-screenshot](screenshots/sync_widgets.png) + +## text_viewer + +A simple text viewer. + +![text_viewer-screenshot](screenshots/text_viewer.png) + +## transparent_main_window + +This example demonstrates how to create a main window with a transparent +background. + +![transparent_main_window-screenshot](screenshots/transparent_main_window.png) + +## tree_model_sort + +This sample demonstrates how to use the `TreeModelSort` widget. + +![tree_model_sort-screenshot](screenshots/tree_model_sort.png) + +## treeview + +This sample demonstrates how to create a `TreeView` with either a `ListStore` +or `TreeStore`. + +![treeview-screenshot](screenshots/treeview.png) + + diff --git a/screenshots/accessibility.png b/screenshots/accessibility.png new file mode 100644 index 0000000..fe13258 Binary files /dev/null and b/screenshots/accessibility.png differ diff --git a/screenshots/basic.png b/screenshots/basic.png new file mode 100644 index 0000000..9d8f93a Binary files /dev/null and b/screenshots/basic.png differ diff --git a/screenshots/basic_subclass.png b/screenshots/basic_subclass.png new file mode 100644 index 0000000..7c9bb86 Binary files /dev/null and b/screenshots/basic_subclass.png differ diff --git a/screenshots/builder_basics.png b/screenshots/builder_basics.png new file mode 100644 index 0000000..d38fd0b Binary files /dev/null and b/screenshots/builder_basics.png differ diff --git a/screenshots/builder_signal.png b/screenshots/builder_signal.png new file mode 100644 index 0000000..09a3444 Binary files /dev/null and b/screenshots/builder_signal.png differ diff --git a/screenshots/builders.png b/screenshots/builders.png new file mode 100644 index 0000000..cd0952f Binary files /dev/null and b/screenshots/builders.png differ diff --git a/screenshots/cairo_threads.png b/screenshots/cairo_threads.png new file mode 100644 index 0000000..556d73d Binary files /dev/null and b/screenshots/cairo_threads.png differ diff --git a/screenshots/cairotest.png b/screenshots/cairotest.png new file mode 100644 index 0000000..2a75159 Binary files /dev/null and b/screenshots/cairotest.png differ diff --git a/screenshots/child-properties.png b/screenshots/child-properties.png new file mode 100644 index 0000000..c2af08a Binary files /dev/null and b/screenshots/child-properties.png differ diff --git a/screenshots/clipboard_simple.png b/screenshots/clipboard_simple.png new file mode 100644 index 0000000..c6bd225 Binary files /dev/null and b/screenshots/clipboard_simple.png differ diff --git a/screenshots/clock.png b/screenshots/clock.png new file mode 100644 index 0000000..7a0b783 Binary files /dev/null and b/screenshots/clock.png differ diff --git a/screenshots/clone_macro.png b/screenshots/clone_macro.png new file mode 100644 index 0000000..8df0dd7 Binary files /dev/null and b/screenshots/clone_macro.png differ diff --git a/screenshots/communication_thread.png b/screenshots/communication_thread.png new file mode 100644 index 0000000..e801c9e Binary files /dev/null and b/screenshots/communication_thread.png differ diff --git a/screenshots/css.png b/screenshots/css.png new file mode 100644 index 0000000..ec43175 Binary files /dev/null and b/screenshots/css.png differ diff --git a/screenshots/drag_and_drop.png b/screenshots/drag_and_drop.png new file mode 100644 index 0000000..f38009f Binary files /dev/null and b/screenshots/drag_and_drop.png differ diff --git a/screenshots/drag_and_drop_text_view.png b/screenshots/drag_and_drop_text_view.png new file mode 100644 index 0000000..e5656df Binary files /dev/null and b/screenshots/drag_and_drop_text_view.png differ diff --git a/screenshots/entry_completion.png b/screenshots/entry_completion.png new file mode 100644 index 0000000..226e750 Binary files /dev/null and b/screenshots/entry_completion.png differ diff --git a/screenshots/grid.png b/screenshots/grid.png new file mode 100644 index 0000000..4ceab75 Binary files /dev/null and b/screenshots/grid.png differ diff --git a/screenshots/gtktest.png b/screenshots/gtktest.png new file mode 100644 index 0000000..834aa1a Binary files /dev/null and b/screenshots/gtktest.png differ diff --git a/screenshots/iconview_example.png b/screenshots/iconview_example.png new file mode 100644 index 0000000..0855309 Binary files /dev/null and b/screenshots/iconview_example.png differ diff --git a/screenshots/list_store.png b/screenshots/list_store.png new file mode 100644 index 0000000..630fc73 Binary files /dev/null and b/screenshots/list_store.png differ diff --git a/screenshots/menu_bar.png b/screenshots/menu_bar.png new file mode 100644 index 0000000..3e54704 Binary files /dev/null and b/screenshots/menu_bar.png differ diff --git a/screenshots/menu_bar_system.png b/screenshots/menu_bar_system.png new file mode 100644 index 0000000..cb0f391 Binary files /dev/null and b/screenshots/menu_bar_system.png differ diff --git a/screenshots/multi_windows.png b/screenshots/multi_windows.png new file mode 100644 index 0000000..bdb94e9 Binary files /dev/null and b/screenshots/multi_windows.png differ diff --git a/screenshots/multithreading_context.png b/screenshots/multithreading_context.png new file mode 100644 index 0000000..8945812 Binary files /dev/null and b/screenshots/multithreading_context.png differ diff --git a/screenshots/notebook.png b/screenshots/notebook.png new file mode 100644 index 0000000..f3d1ed0 Binary files /dev/null and b/screenshots/notebook.png differ diff --git a/screenshots/overlay.png b/screenshots/overlay.png new file mode 100644 index 0000000..75ed9cf Binary files /dev/null and b/screenshots/overlay.png differ diff --git a/screenshots/pango_attributes.png b/screenshots/pango_attributes.png new file mode 100644 index 0000000..4de090a Binary files /dev/null and b/screenshots/pango_attributes.png differ diff --git a/screenshots/printing.png b/screenshots/printing.png new file mode 100644 index 0000000..9abcdb7 Binary files /dev/null and b/screenshots/printing.png differ diff --git a/screenshots/progress_tracker.png b/screenshots/progress_tracker.png new file mode 100644 index 0000000..c4374f3 Binary files /dev/null and b/screenshots/progress_tracker.png differ diff --git a/screenshots/simple_treeview.png b/screenshots/simple_treeview.png new file mode 100644 index 0000000..b2618bd Binary files /dev/null and b/screenshots/simple_treeview.png differ diff --git a/screenshots/sync_widgets.png b/screenshots/sync_widgets.png new file mode 100644 index 0000000..26eef19 Binary files /dev/null and b/screenshots/sync_widgets.png differ diff --git a/screenshots/text_viewer.png b/screenshots/text_viewer.png new file mode 100644 index 0000000..fd81c47 Binary files /dev/null and b/screenshots/text_viewer.png differ diff --git a/screenshots/transparent_main_window.png b/screenshots/transparent_main_window.png new file mode 100644 index 0000000..be699fe Binary files /dev/null and b/screenshots/transparent_main_window.png differ diff --git a/screenshots/tree_model_sort.png b/screenshots/tree_model_sort.png new file mode 100644 index 0000000..c480456 Binary files /dev/null and b/screenshots/tree_model_sort.png differ diff --git a/screenshots/treeview.png b/screenshots/treeview.png new file mode 100644 index 0000000..8c94d59 Binary files /dev/null and b/screenshots/treeview.png differ