admin管理员组

文章数量:1435859

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

Without 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.

本文标签: How to programmatically close a GtkDropDown list39s popup in GTK4Stack Overflow