I'm working with GTK4 and using a GtkDropDown widget to show a list of items. I regularly needed to update the list. I want to disable the dropdown and close pop up menu (if opened by the user). Thus, I need to programmatically close the dropdown's pop-up list before updating the list.
Is there a function or method in GTK4 that allows me to close the pop-up list of a GtkDropDown programmatically?
Thanks for your help
I'm working with GTK4 and using a GtkDropDown widget to show a list of items. I regularly needed to update the list. I want to disable the dropdown and close pop up menu (if opened by the user). Thus, I need to programmatically close the dropdown's pop-up list before updating the list.
Is there a function or method in GTK4 that allows me to close the pop-up list of a GtkDropDown programmatically?
Thanks for your help
Share Improve this question asked Nov 15, 2024 at 21:07 aliaktasaliaktas 16510 bronze badges1 Answer
Reset to default 0Without Programmscrip, the problem is not really understandable. All the programs I create complete the GtkDropDown when it loses its focus.
That's why I recommend trying the features inherited from GtkWidget to control the focus.
void
gtk_root_set_focus (
GtkRoot* self,
GtkWidget* focus
)
...
void
gtk_window_set_focus (
GtkWindow* window,
GtkWidget* focus
)
and so on.
Have fun testing.