Slides at bilelmoussaoui.github.io/guadec-2023/
GtkBuilderScope integration
#[gtk::template_callbacks]
impl MyWidget {
#[template_callback]
fn button_clicked(&self, button: >k::Button) {
println!("button clicked!")
}
#[template_callback]
async fn some_other_callback(&self, button: >k::Button) {
use ashpd::desktop::screenshot::Color;
let color = Color::request().send().await.unwrap().response().unwrap();
println!("{:#?}", color)
}
}
Procedural macro for generating GObject properties boilerplate
#[derive(glib::Properties, Default)]
#[properties(wrapper_type = super::CustomObject)]
pub struct CustomObject {
#[property(get, set = Self::set_prop, construct)]
prop: RefCell<String>,
}
#[glib::derived_properties]
impl ObjectImpl for CustomObject {}
impl CustomObject {
fn set_prop(&self, value: &str) {
*self.prop.borrow_mut() = format!("custom set: {}", value);
}
}
gdk4-win32 bindings
Reduced allocations by introductions various collections types:
glib::List
,glib::SList
,
glib::Strv
glib::wrapper!