-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade muda
to gtk4-rs
#270
Labels
Comments
I did a bit of testing and research and this is not going to be an easy task at all, a lot of the APIs has changed and it may require a full rewrite of the gtk backend from scratch. Here is a dump of what I discovered in case anyone wants to help:
And another dump of code that I was testing with (not fully working, adapted from https://github.com/gtk-rs/gtk4-rs/blob/main/examples/menubar/main.rs) fn main() {
let window = gtk4::ApplicationWindow::builder()
.application(application)
.title("Menubar Example")
.default_width(350)
.default_height(350)
.show_menubar(true)
.build();
let menubar = {
let file_menu = {
let about_menu_item = gtk4::gio::MenuItem::new(Some("About"), Some(&"muda.about"));
let quit_menu_item = gtk4::gio::MenuItem::new(Some("Quit"), Some(&"muda.quit"));
let file_menu = gtk4::gio::Menu::new();
file_menu.append_item(&about_menu_item);
file_menu.append_item(&quit_menu_item);
file_menu
};
let menu_bar_m = gtk4::gio::Menu::new();
menu_bar_m.append_item(>k4::gio::MenuItem::new_submenu(Some("File"), &file_menu));
let menubar = gtk4::PopoverMenuBar::from_model(Some(&menu_bar_m));
menubar
};
let action = gio::SimpleAction::new_stateful("about", None, &glib::Variant::from(true));
action.connect_activate(move |_, _| {
println!("about");
});
application.set_accels_for_action("muda.about", &["<Control>C"]);
let action_group = gio::SimpleActionGroup::new();
action_group.add_action(&action);
window.insert_action_group("muda", Some(&g));
let vbox = gtk4::Box::new(gtk4::Orientation::Vertical, 0);
vbox.append(&menubar);
window.set_child(Some(&vbox));
} |
amrbashir
added a commit
that referenced
this issue
Feb 1, 2025
closes #270 kicking off work on gtk4 migration help is appreciated
Draft
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We need to upgrade from
gtk
togtk4-rs
to migrate a unsoundness issue found in glib < 0.2.Please claim this issue if you want to support or work on this and keep in mind this is a prioritized issue and we try to migrate as soon as possible. If the issue is already assigned to someone you can either reach out with comments or questions reach out for collaboration to the assigned person.
This transition includes:
gtk
togtk4-rs
and handling all errors caused by the dependency changeThe text was updated successfully, but these errors were encountered: