Grade - A macro for rapid gtk-rs development
Grade is a macro for declarative development of gtk-rs. It provides the macro build!
that creates a GTK widget from declaration.
use gtk::*;
use grade::build;
let main_window = build! {
Window {
title: "Grade test",
show_menubar: false,
default_height: 300,
default_width: 400,
=> activate_focus: |_| { },
=> notify(title): |_| { },
-- Viewport {
-- main_grid: Grid {
vexpand: true,
name: "main_grid",
-- [attach, 1, 1, 1, 1] Label {
label: "Please type...",
}
..insert_row(2)
..attach(
& build!().downcast::<Widget>(),
1, 2, 3, 3
)
}
}
}
};