slint/examples
Olivier Goffart fd45f575d7 Some improvement of the main screen of the printer demo
Apply some of the hints from the reddit thread

 - make sure the icons are centered
 - make sure the spacing and padding of the main buttons are the same
 - make the color slightly lighter
 - align the title ind controls in the top bar
2020-11-16 17:23:56 +01:00
..
gallery Change C++ API to use the ComponentHandle 2020-11-10 19:28:34 +01:00
printerdemo Some improvement of the main screen of the printer demo 2020-11-16 17:23:56 +01:00
slide_puzzle slide_puzzle: Thumb up icon when winning 2020-11-16 13:30:48 +01:00
todo Change C++ API to use the ComponentHandle 2020-11-10 19:28:34 +01:00
README.md Remove the www from all sixtyfps.io URL 2020-10-29 11:06:06 +01:00

Examples

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

printerdemo

A fictional user interface for the touch screen of a printer

.60 Design Rust Source C++ Source Node Source Online wasm Preview Open in code editor
ui.60 main.rs main.cpp main.js Online simulation Preview in Online Code Editor

Screenshot of the Printer Demo

A simple application showing the different widgets

.60 Design Rust Source C++ Source Online wasm Preview Open in code editor
gallery.60 main.rs main.cpp Online simulation Preview in Online Code Editor

Screenshot of the Gallery on Windows

todo

A simple todo mvc application

.60 Design Rust Source C++ Source Node Source Online wasm Preview Open in code editor
todo.60 main.rs main.cpp main.js Online simulation Preview in Online Code Editor

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

  • When compiling SixtyFPS from sources: If you follow the C++ build instructions, this will build the C++ examples as well by default

  • From installed binary packages: Simply run cmake in one of the example directory containing a CMakeLists.txt

mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH="<path to installed>" ..
cmake --build .

Running the Node Examples

You can run the examples by going into the node sub-folder and use npm, for example:

cd examples/printerdemo/node
npm install
npm start