Hi, is there common sensus / default approach for doing bind_with_mapping in Python and other languages? I see why it is not available, as get callback is done via pointers, but I guess we have to use control signal callback along with setting value in GSettings. Just wondering, thanks for any ideas.
This can be used but someone must manually write a binding to that function and contribute it to pygobject. āNot directly availableā just means the function does something that is beyond the automatic capabilities of gobject-introspection.
If I had some in-depth knowledge, I would definitely take a dive at it. At the moment a bit busy with other code
Said that, I wanted to share my current approach in case someone else tries it:
ActionRow.connect(ānotify::selectedā, on_action_row_selected)
def on_action_row_selected(widget, spec):
value = widget.props.selected
settings.set_int(āsettings-keyā, value)
Iām presently trying to wrap g_settings_bind_with_mapping() in C++ code in glibmm.
Itās possible, but itās one of the more complicated glib functions to wrap in C++.
There are similarities between wrapping g_settings_bind_with_mapping() and
wrapping g_object_bind_property_full(). If there is a Python binding of
g_object_bind_property_full(), you can probably get some hints there.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.