AdwComboRow: How to run a function when user chooses from the popover?

I need to show related AdwActionRow and hide all other AdwActionRows when user selects something from the choices given in an AdwComboRow.

How do I do that?

Unlike GtkComboBox, AdwComboRow doesn’t have a changed signal which could conveniently be connected to the desired function.

I’m not going to use GtkComboBox inside an AdwActionRow because it does not look good inside an AdwActionRow.

I tried connecting activated signal but it seems activated signal is never emitted.

I tried connecting state-changed signal but it is emitted too frequently to be useful. It meddles with user input and it is hard even to select something.

Any Ideas?

You’ll want to use notify::selected or notify::selected-item.

1 Like

Thanks.

How do I do that?

Is notify::selected a signal, function? What library is it part of: Glib, Gio, GTK, LibAdwaita?

Edit: Nevermind. I found out it is a signal. Thanks again.

It’s a signal. For any readable property, you can connect to the notify signal that’s part of glib, with the property name being the detail you pass. So in pseudocode, you can do something like this:

g_signal_connect (object, "notify::$PROP_NAME_HERE", ...);

More detail here.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.