GNOME Bugzilla – Bug 702742
Glade serializes the "visible" and "sensitive" properties of a GtkWidget with a "related-action" set.
Last modified: 2018-03-26 15:30:40 UTC
When a GtkButton has a related action, visible and sensitive properties are always disabled regardless of use-action-appearance is set to False. They become editable only when there's no related action.
This is intended, and there should also be a tooltip on the insensitive properties explaining why. Visibility and Sensitivity are not appearance related properties, they are *always* controlled by the related action.
The doc says: Properties that are always mirrored by proxies are "sensitive" and "visible" so Glade is right. But I have <object class="GtkAction" id="Act"> <property name="visible">False</property> </object> ... <object class="GtkCheckButton" id="Btn"> <property name="related_action">Act</property> The CheckButton is visible at run time (not in glade). I have to put <property name="visible">False</property> for the button too to make it hidden
Hi, Can you let us know what version of GTK+ you are using ? This would certainly be a GTK+ bug, so we should get the version and move this bug to GTK+ produce. It would be helpful also if you could provide any other information, such as... does this only happen when initially loading the Glade file ? If you grab the related action and set it's visibility to TRUE and then FALSE again, does the button stay visible ?
Created attachment 247413 [details] test case When there's a related action, Glade save always the visible properties of the object, not the Action, with value True resulting in a visible button. If I remove the property in the GtkButton object, editing the glade file by hand, the behavior is correct. Setting the GtkAction property by code the button is correctly hidden. So I can't say if it's a Glade or a Gtk bug.
Interesting, it looks like strictly speaking, a GTK+ bug. But a bug that we can also workaround in Glade. I'm reopening this as a Glade bug for now, we should be able to provide a decent workaround for this. Proposed solution(s): a.) Ensure that widget properties that are controlled by a related action are not saved (appearance related properties should not be saved if use-action-appearance is TRUE) b.) Just ensure that the 'related-action' property is serialized 'last' Option 'a' is surely better than 'b', but 'b' will probably be easier to implement and cause less complexity in Glade's core. Strictly speaking, it could be a GTK+ bug that calling gtk_widget_show() on a widget that is a proxy of an invisible GtkAction, but I think it's a rather unlikely situation to handle for GTK+.
I've filed a bug in GTK+
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glade/issues/133.