slint/examples/plotter/plotter.slint
2022-02-02 10:05:45 +01:00

35 lines
948 B
Text

// Copyright © SixtyFPS GmbH <info@sixtyfps.io>
// SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)
import { Slider, GroupBox, HorizontalBox, VerticalBox } from "std-widgets.slint";
export MainWindow := Window {
title: "SixtyFPS Plotter Integration Example";
preferred-width: 800px;
preferred-height: 600px;
callback render_plot(float) -> image;
VerticalBox {
Text {
font-size: 20px;
text: "2D Gaussian PDF";
horizontal-alignment: center;
}
Image {
source: root.render_plot(pitch-slider.value);
}
HorizontalBox {
Text {
text: "Pitch:";
font-weight: 600;
vertical-alignment: center;
}
pitch-slider := Slider {
minimum: 0;
maximum: 180;
value: 42;
}
}
}
}