Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
Alexis Lozano edited this page Sep 21, 2019 · 1 revision

Preamble

Neutrino is full of suprise ! You can do other things not written in the first parts of this tutorial. Let us dive in some other features.

Time generated events

Let say you want to count the seconds elapsed since the launch your application. You can ! Just use the set_timer(1000) function on your Window object :

// ...

let mut window = Window::new();
window.set_title("Timer");
window.set_size(320, 240);
window.set_child(Box::new(button));
window.set_timer(1000); // period in ms 
window.set_listener(Box::new(wlistener));

App::run(window);

Here, a Tick event will be emitted every 1000ms = 1s. Look at the result of the timer example :

Side Pane

You can create a Sidepane very easily with Neutrino ! You just have to add tabs with Direction::Vertical. Here is the result on demo_fluent :

  1. Preamble
  2. Install
  3. Examples
  1. Preamble
  2. Your first window
  3. Add a label
  4. Conclusion
  1. Preamble
  2. What is MVC ?
  3. A simple counter
  4. Conclusion
  1. Preamble
  2. Display an image
  3. Add the previous and next buttons
  4. Add the menu bar
  5. Add keyboard shortcuts
  6. Conclusion
  1. Preamble
  2. User-defined styles
  3. Neutrino-defined themes
  4. Icons
  5. Conclusion
  1. Preamble
  2. Time generated events
  3. Side Pane
Clone this wiki locally