add some no-indicator radio buttons

2001-11-16  jacob berkman  <jacob@ximian.com>

	* tests/testgtk.c (create_radio_buttons): add some no-indicator
	radio buttons

	* gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
	initially active, also initially be depressed
	(gtk_radio_button_clicked): also update our depressed state
This commit is contained in:
jacob berkman 2001-11-16 22:56:21 +00:00 committed by Jacob Berkman
parent c344b3f905
commit 8d99d6af28
9 changed files with 94 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2001-11-16 jacob berkman <jacob@ximian.com>
* tests/testgtk.c (create_radio_buttons): add some no-indicator
radio buttons
* gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
initially active, also initially be depressed
(gtk_radio_button_clicked): also update our depressed state
Thu Nov 15 12:54:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_key_press_event): Propagate

View File

@ -1,3 +1,12 @@
2001-11-16 jacob berkman <jacob@ximian.com>
* tests/testgtk.c (create_radio_buttons): add some no-indicator
radio buttons
* gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
initially active, also initially be depressed
(gtk_radio_button_clicked): also update our depressed state
Thu Nov 15 12:54:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_key_press_event): Propagate

View File

@ -1,3 +1,12 @@
2001-11-16 jacob berkman <jacob@ximian.com>
* tests/testgtk.c (create_radio_buttons): add some no-indicator
radio buttons
* gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
initially active, also initially be depressed
(gtk_radio_button_clicked): also update our depressed state
Thu Nov 15 12:54:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_key_press_event): Propagate

View File

@ -1,3 +1,12 @@
2001-11-16 jacob berkman <jacob@ximian.com>
* tests/testgtk.c (create_radio_buttons): add some no-indicator
radio buttons
* gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
initially active, also initially be depressed
(gtk_radio_button_clicked): also update our depressed state
Thu Nov 15 12:54:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_key_press_event): Propagate

View File

@ -1,3 +1,12 @@
2001-11-16 jacob berkman <jacob@ximian.com>
* tests/testgtk.c (create_radio_buttons): add some no-indicator
radio buttons
* gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
initially active, also initially be depressed
(gtk_radio_button_clicked): also update our depressed state
Thu Nov 15 12:54:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_key_press_event): Propagate

View File

@ -1,3 +1,12 @@
2001-11-16 jacob berkman <jacob@ximian.com>
* tests/testgtk.c (create_radio_buttons): add some no-indicator
radio buttons
* gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
initially active, also initially be depressed
(gtk_radio_button_clicked): also update our depressed state
Thu Nov 15 12:54:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_key_press_event): Propagate

View File

@ -1,3 +1,12 @@
2001-11-16 jacob berkman <jacob@ximian.com>
* tests/testgtk.c (create_radio_buttons): add some no-indicator
radio buttons
* gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
initially active, also initially be depressed
(gtk_radio_button_clicked): also update our depressed state
Thu Nov 15 12:54:36 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_key_press_event): Propagate

View File

@ -116,6 +116,7 @@ gtk_radio_button_init (GtkRadioButton *radio_button)
radio_button->group = g_slist_prepend (NULL, radio_button);
_gtk_button_set_depressed (GTK_BUTTON (radio_button), TRUE);
gtk_widget_set_state (GTK_WIDGET (radio_button), GTK_STATE_ACTIVE);
}
@ -495,6 +496,7 @@ gtk_radio_button_clicked (GtkButton *button)
GtkStateType new_state;
GSList *tmp_list;
gint toggled;
gboolean depressed;
g_return_if_fail (GTK_IS_RADIO_BUTTON (button));
@ -552,12 +554,21 @@ gtk_radio_button_clicked (GtkButton *button)
new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
}
if (toggle_button->inconsistent)
depressed = FALSE;
else if (button->in_button && button->button_down)
depressed = !toggle_button->active;
else
depressed = toggle_button->active;
if (GTK_WIDGET_STATE (button) != new_state)
gtk_widget_set_state (GTK_WIDGET (button), new_state);
if (toggled)
gtk_toggle_button_toggled (toggle_button);
_gtk_button_set_depressed (button, depressed);
gtk_widget_queue_draw (GTK_WIDGET (button));
gtk_widget_unref (GTK_WIDGET (button));

View File

@ -680,6 +680,26 @@ create_radio_buttons (void)
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
button = gtk_radio_button_new_with_label (NULL, "button4");
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
button = gtk_radio_button_new_with_label (
gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
"button5");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
button = gtk_radio_button_new_with_label (
gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
"button6");
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);