最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to programmatically close a GtkDropDown list's popup in GTK4 - Stack Overflow

programmeradmin2浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论