如何禁用GTK3中的按钮 [英] How to disable buttons in GTK3

查看:68
本文介绍了如何禁用GTK3中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows API具有名为 EnableWindow 的功能,该功能会禁用控件,因此用户无法再与它们进行交互.

Windows API has a function called EnableWindow that disables controls so user can't interact with them any more.

GTK3或GTK3 ++是否等效?

Is there an equivalent for GTK3 or GTK3++?

推荐答案

gtk_widget_set_sensitive (widget, FALSE);

请注意,如果您需要检查小部件是否敏感,则 gtk_widget_get_sensitive()返回使用上述函数设置的值,并且 gtk_widget_is_sensitive()会告诉您是否小部件确实很敏感-这也受父小部件敏感性的影响.

Note that if you need to check whether a widget is sensitive, gtk_widget_get_sensitive() returns the value set with the above function and gtk_widget_is_sensitive() will tell you whether the widget really is sensitive -- this is affected by parent widgets sensitivity as well.

这篇关于如何禁用GTK3中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆