zng/examples
Samuel Guerra e77fcd3948 Changed version of every crate to 0.2.0. 2024-03-30 17:30:08 -03:00
..
res Added logo images. 2024-03-30 00:47:52 -03:00
util Changed version of every crate to 0.2.0. 2024-03-30 17:30:08 -03:00
Cargo.toml Changed instances of 'zero-ui' to 'zng'. 2024-03-26 21:02:49 -03:00
README.md Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
animation.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
border.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
button.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
calculator.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
config.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
countdown.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
cursor.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
extend_view.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
focus.rs All tests pass. 2024-03-27 01:26:20 -03:00
gradient.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
headless.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
icon.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
image.rs Added logo images. 2024-03-30 00:47:52 -03:00
layer.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
localize.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
markdown.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
respawn.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
scroll.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
shortcuts.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
text.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
transform.rs Changed instances of 'zero_ui' to 'zng'. 2024-03-26 21:12:13 -03:00
window.rs Added zng logo and better icon resize. 2024-03-29 23:49:42 -03:00

README.md

Examples

This directory contains small example apps.

Running

To run an example use cargo do run $name.

Adding an Example

To add an example, create a file then add it in ./Cargo.toml.

Template

This is a good example template:

In ./foo.rs:

#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

use zng::prelude::*;

use zng::view_process::prebuilt as view_process;

fn main() {
    examples_util::print_info();
    // view_process::run_same_process(app_main);

    view_process::init();
    app_main();
}

fn app_main() {
    APP.defaults().run_window(async {
        Window! {
            title = "Foo Example";
            child = Text!("Bar");
        }
    })
}

Then add in ./Cargo.toml:

[[example]]
name = "foo"
path = "foo.rs"

Then run from the project root using cargo do run foo.