abletk/src/main.rs

30 lines
967 B
Rust
Executable File

/*
* Copyright (C) 2022 Umut İnan Erdoğan <umutinanerdogan@pm.me>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
use abletk::plugin::QuitPlugin;
use abletk::prelude::*;
#[launch]
fn launch() -> _ {
Application::new()
.apply_plugin(QuitPlugin)
.add_window(Window::builder(
Row::new()
.add(Label::new("Hello, ")
.color(rgb!(0xFF00FFFF)))
.add(Column::new()
.add(Label::new("World!"))
.add(Label::new("AbleTK!")))
.add(Label::new("this is a label!")
.bg_color(rgb!(0xFF0000FF)))
.padding_left(10))
.on_event(WindowEvent::Resized, |_, window| {
println!("window resized: {:?}", window.size())
}))
}