Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Add a reference document of all examples with screenshots #333

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
238 changes: 238 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
@@ -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)


Binary file added screenshots/accessibility.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/basic_subclass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/builder_basics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/builder_signal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/builders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/cairo_threads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/cairotest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/child-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clipboard_simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clone_macro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/communication_thread.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/css.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/drag_and_drop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/drag_and_drop_text_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/entry_completion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/gtktest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/iconview_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/list_store.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/menu_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/menu_bar_system.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/multi_windows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/multithreading_context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/notebook.png
Binary file added screenshots/overlay.png
Binary file added screenshots/pango_attributes.png
Binary file added screenshots/printing.png
Binary file added screenshots/progress_tracker.png
Binary file added screenshots/simple_treeview.png
Binary file added screenshots/sync_widgets.png
Binary file added screenshots/text_viewer.png
Binary file added screenshots/transparent_main_window.png
Binary file added screenshots/tree_model_sort.png
Binary file added screenshots/treeview.png