Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Gtk+/Gnome Application Development
Prev Home Next

Sensitivity

Widgets can be sensitive or insensitive; insensitive widgets do not respond to input. (On other platforms, this is termed "ghosted" or "inactive").

gtk_widget_set_sensitive() (Figure 25) changes a widget's sensitivity.

#include <gtk/gtkwidget.h>

void gtk_widget_set_sensitive(GtkWidget* widget, gboolean setting);

Figure 25. Changing Sensitivity

By default sensitivity is set to TRUE. A widget is only "really" sensitive if all its parents are sensitive; that is, you can make an entire container full of widgets (in)sensitive by setting the sensitivity of the container. The "real" sensitivity of a widget, including its parent's state, can be tested with the GTK_WIDGET_IS_SENSITIVE() macro. The sensitivity of the widget itself, which only matters if the widget's parent is sensitive, can be queried using GTK_WIDGET_SENSITIVE(). These are in Figure 26.

#include <gtk/gtkwidget.h>

GTK_WIDGET_IS_SENSITIVE(widget);

GTK_WIDGET_SENSITIVE(widget);

Figure 26. Sensitivity

Gtk+/Gnome Application Development
Prev Home Next

 
 
  Published under free license. Design by Interspire