Gtk 4.0 released! It's time to upgrade.
zoujiaqing opened this issue ยท 13 comments
Yes, please provide the gtk4 bindings.
I sincerely hope that D catches up! If I was an expert at GObject introspection, I would work on this for sure.
With commit 8617414 the gtk4 branch of GtkD compiles.
I don't know if the compiled library works and the demos need to be updated.
Still a work in progress.
That's awesome. With a bit of tweaking, I was able to run a simple gtk4 application.
I'm currently "slowly" updating the demos to Gtk4 mostly to see if any issues with the generated binding show up.
It would help if someone could work on updating some of the demos and reporting/fixing the issues that surface.
I'm currently working on the two remaining in demos/gtk/.
@MikeWey Funny you mention that because I started working through the TestWindow demo, it's compiling now, but I'm not sure if I have time to work through the runtime errors. There's a lot of breakage there, but luckily it seems to be relegated to
- Some missing (perhaps intentionally removed) constructors in certain widgets.
- Breaking changes in the gtk api.
Here are my full notes, might be missing some stuff:
GtkD 3 -> 4 Discovered breaking changes.
Things that I think might have broken in gir-to-d code gen.
Dialogs
- FileChooserDialog(string title, Window win, FileChooserAction action) ctor missing.
- FileChooserDialog() ctor missing.
- MessageDialog() ctor missing.
TreeModel
- getIter*() methods no longer return iters, instead have "out" parameters.
TreeView
- TreeViewCollumn(string title, CellRendererIF cellRenderer, string something, int column) ctor is missing. setTitle + addAttribute now used.
Menus
- MenuModel missing primary ctor
MenuModel()
Frame
- Missing ctor(Widget framed, string title)
Button
- Button.fromIconName(string iconName) static function missing
- Button.withLabel(string label) static function missing
- Button(string label, delegate onClicked) convenience ctor missing
GStreamer
- DateTime has conflicting ctors
Peas
- Gtk.Menu -> GMenu
- GtkMenu -> GMenu*
Things that broke in the demo because of Gtk4 Deprecations
Gtk
- ColorSelectionDialog renamed to ColorChooserDialog
- FontSelectionDialog renamed to FontChooserDialog
- Dialogs are now fully async and do not have .run() methods as a result.
- Dialogs require window as second arg of ctors
- NoteBook.appendPage now requires Widget as second arg, instead of string.
- Window.showAll gone
Gdk
- GtkPoint gone
Things I'm not really sure what's going on
Many things that seemed to previously take things convertible to a gtk.Value, now require you to wrap them in a gtk.Value. gtk.TreeStore .setValue for example now requires a gtk.Value, and won't accept a string.
Created a PR so you can see what I changed... Lots of broken stuff at the moment #320
The gtk3 binding still had a lot of thing manually tweaked to be compatible with an older generator that used the HTML documentation as a basis. So when switching to gtk4 i started with a blank slate, and because of that some/a lot of convenience functions may need to re added.
Things that I think might have broken in gir-to-d code gen.
Dialogs
1. FileChooserDialog(string title, Window win, FileChooserAction action) ctor missing. 2. FileChooserDialog() ctor missing. 3. MessageDialog() ctor missing.
Missing because gir-to-d currently doesn't handle variadics, need to be added manually.
TreeModel
1. getIter*() methods no longer return iters, instead have "out" parameters.
The old one also doesn't return the iter, marking it as out is correct.
TreeView
1. TreeViewCollumn(string title, CellRendererIF cellRenderer, string something, int column) ctor is missing. setTitle + addAttribute now used.
Same issue as the dialogs.
Menus
1. MenuModel missing primary ctor `MenuModel()`
On the GIO side MenuModel is an abstract class, so it is correct that it doesn't have a constructor. We could investigate attributing them as 'abstract' on the D side, that would require a solution similar to the one for interfaces to be able to return the abstract class from a wrapper function.
Frame
1. Missing ctor(Widget framed, string title)
Was a manually added convenance function, may need to be re added.
Button
1. Button.fromIconName(string iconName) static function missing 2. Button.withLabel(string label) static function missing 3. Button(string label, delegate onClicked) convenience ctor missing
These also will probably need to be re added, a more general solution for duplicate constructors in gir-to-d would be best.
GStreamer
1. DateTime has conflicting ctors
One of them will need to be replaced with a static function.
Peas
1. Gtk.Menu -> GMenu 2. GtkMenu -> GMenu*
Peas may depend on gtk3 GtkMenu / gtk.Menu was replaced by the gio menu model/classes with gtk4.
Things I'm not really sure what's going on
Many things that seemed to previously take things convertible to a gtk.Value, now require you to wrap them in a gtk.Value. gtk.TreeStore .setValue for example now requires a gtk.Value, and won't accept a string.
Probably a lot of convenience functions that are now missing.
It has been more than a year since this thread began, is there any improvements?
Where's the progress on this up to? Is any help needed?
Posted this issue on BountySource. If you want to see this issue resolved, please help and contribute to the bounty:
https://app.bountysource.com/issues/95837122-gtk-4-0-released-it-s-time-to-upgrade
At least for Tilix, I would love to see this, but I'm afraid that interest in D is pretty low to make this happen ๐.