We have a recent request for GtkBuilder support for GtkFileChooserNative, see
opened 10:48AM - 10 Jan 21 UTC
Title self explanatory. FileChooserNative is highly encouraged especially when an app is shipped with Flatpak in order to call the proper...
I am wondering why the GtkFileChooserNative is missing, while most other buildable widgets are supported automatically by our generator script.
In https://developer.gnome.org/gtk4/stable/GtkFileChooserNative.html buildable seems to be not mentioned.
And from the gir files we get:
grep -C24 GtkFileChooserNative /usr/share/gir-1.0/Gtk-3.0.gir | grep implements
<implements name="FileChooser"/>
[1]+ Done gedit /usr/share/gir-1.0/Gtk-3.0.gir
salewski@nuc ~/gintrotest/tests $ grep -C24 GtkFileChooser /usr/share/gir-1.0/Gtk-3.0.gir | grep implements
<implements name="Atk.ImplementorIface"/>
<implements name="Actionable"/>
<implements name="Activatable"/>
<implements name="Buildable"/>
implements the #GtkFileChooser interface unless you are trying to
file. It implements the #GtkFileChooser interface. Visually, it is a
<implements name="Atk.ImplementorIface"/>
<implements name="Buildable"/>
<implements name="FileChooser"/>
<implements name="Orientable"/>
implements the #GtkFileChooser interface and must not have
<implements name="Atk.ImplementorIface"/>
<implements name="Buildable"/>
<implements name="FileChooser"/>
<implements name="FileChooser"/>
<implements name="Atk.ImplementorIface"/>
<implements name="Buildable"/>
<implements name="FileChooser"/>
<implements name="Orientable"/>
So may there be a good reason that buildable is not supported?
Seems to be not an easy question
My first idea was to just assume that all GTK Widgets are buildable and so have Glade support, so I was going to add missing builder support for GtkFileChooserNative manually. Same as it is done automatically for other widgets.
But from https://developer.gnome.org/gtk4/unstable/GtkBuildable.html there seems to be indeed no support for native widgets. (Well I assume he is still using GTK3 and wants to use Glade for a GtkFileChooserNative.)
So shall I just tell him that he should forget using GtkFileChooserNative with Glade and close the issue?
[EDIT]
On the other hand, from Description in GtkBuildable.html:
The GtkBuildable interface is implemented by all widgets and many of the non-widget objects that are provided by GTK.
So maybe my initial idea is good, so just add it to the bindings and wait for crashes…
zbrown
(Zander Brown)
January 11, 2021, 10:19pm
3
GtkBuilder can build any GObject and GtkFileChooserNative is a GObject
Of could the greater question is why do you want to do this
Of could the greater question is why do you want to do this
A customer of the Nim gobject-introspection based GTK bindings seems to want to do that, he opened an issue for that.
And I hesitated to add it manually as it was not advertised automatically by gobject-introspection. We generally avoid adding untested code manually which may then crash. But I think I will add it for him, he can test himself.
zbrown
(Zander Brown)
January 12, 2021, 10:41am
5
Huh? Add what to what manually?
sdroege
(Sebastian Dröge)
January 12, 2021, 10:55am
6
Or to be more clear: GtkFileChooserNative
does not implement GtkBuildable
and you can’t just add that in the bindings. That’s not going to work.
The main question here is probably how you want to actually use a GtkFileChooserNative
that would implement GtkBuildable
.
1 Like
ebassi
(Emmanuele Bassi)
January 12, 2021, 11:24am
7
There’s a fundamental misunderstanding, here.
GtkBuilder
can deserialise any object type out of the box.
The GtkBuildable
interface is implemented by object types that need to parse custom properties or custom elements in the XML. It is not required to be implemented by every object type that needs to be deserialised from XML.
3 Likes
system
(system)
Closed
January 26, 2021, 11:35am
8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.