slint/examples
2020-09-30 18:30:19 +02:00
..
cpptest Rename ScrollArea to ScrollView 2020-09-28 10:52:29 +02:00
gallery Add a LineEdit widget to the ugly and native style 2020-09-18 18:54:37 +02:00
nodetest Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
printerdemo Start code egeneration for the two ways binding 2020-09-24 14:37:16 +02:00
rusttest Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
rusttest2 Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
todo C++ model for the todo example in C++ 2020-09-30 18:30:19 +02:00
README.md Additions to the building documentation 2020-09-07 10:46:02 +02:00

Examples

These examples demonstrate the main features of SixtyFPS and how to use them in different language environments.

Demo .60 Design Rust Source C++ Source Description
printerdemo ui.60 main.rs main.cpp A fictional user interface for the touch screen of a printer
gallery gallery.60 main.rs main.cpp A gallery of different widgets
Example Source File .60 Design Description
cpptest main.cpp hello.60 A minimal example to show a .60 design in a window.
rusttest2 main.rs hello.60 A minimal example to show a .60 design in a window.

Loading the example with the viewer

Simply load the .60 file with the viewer application

cargo run --release --bin viewer -- examples/printerdemo/ui/printerdemo.60

Running the Rust Examples

You can run the examples either by going into the rust sub-folder and use cargo run, for example:

cd examples/printerdemo/rust
cargo run --release

or you can run them from anywhere in the Cargo workspace by name:

cargo run --release --bin printerdemo

Running the C++ Examples

The C++ API comes with a CMake integration, which needs to be built first:

cargo xtask cmake

This creates CMake configuration files in the target/debug folder (or target/release if you run cargo xtask cmake --release).

Then, from another directory, you can run cmake in the cpp folder of an example:

cd examples/printerdemo/cpp
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=../../../../target/debug/ ..
cmake --build .
./printerdemo