Re: How to forbid people to change GtkCheckButton's status manually?
- From: David NeÄas <yeti physics muni cz>
- To: donglongchao <donglongchao 163 com>
- Cc: gtk-app <gtk-app-devel-list gnome org>
- Subject: Re: How to forbid people to change GtkCheckButton's status manually?
- Date: Wed, 26 Aug 2009 10:39:29 +0200
On Wed, Aug 26, 2009 at 04:23:34PM +0800, donglongchao wrote:
I want to use some GtkCheckButton to display some status in my app.But I want to forbid my customer to
change these checkbuttons' status(choosed or not ) by their hands,and they can only be changed by my app
itself according to some values,etc..I want to know how to do this.Will some one help me?Thank you.
#include <gtk/gtk.h>
int
main(int argc, char *argv[])
{
GtkWidget *window, *button;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
button = gtk_check_button_new();
/* Do not accept focus, also prevents changing by keyboard */
g_object_set(button, "can-focus", FALSE, 0);
/* Do not respond to mouse events */
g_signal_connect(button, "button-press-event", G_CALLBACK(gtk_true), NULL);
g_signal_connect(button, "button-release-event", G_CALLBACK(gtk_true), NULL);
/* Do not change appearance on mouseover */
g_signal_connect(button, "enter-notify-event", G_CALLBACK(gtk_true), NULL);
g_signal_connect(button, "leave-notify-event", G_CALLBACK(gtk_true), NULL);
gtk_container_add(GTK_CONTAINER(window), button);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
Yeti
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]