]> Pileus Git - ~andy/gtk/blob - gtk/gtkradiobutton.c
Don't focus unmapped radio buttons
[~andy/gtk] / gtk / gtkradiobutton.c
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #include "config.h"
28 #include "gtklabel.h"
29 #include "gtkmarshalers.h"
30 #include "gtkradiobutton.h"
31 #include "gtkprivate.h"
32 #include "gtkintl.h"
33 #include "gtkalias.h"
34
35
36 enum {
37   PROP_0,
38   PROP_GROUP
39 };
40
41
42 static void     gtk_radio_button_destroy        (GtkObject           *object);
43 static gboolean gtk_radio_button_focus          (GtkWidget           *widget,
44                                                  GtkDirectionType     direction);
45 static void     gtk_radio_button_clicked        (GtkButton           *button);
46 static void     gtk_radio_button_draw_indicator (GtkCheckButton      *check_button,
47                                                  GdkRectangle        *area);
48 static void     gtk_radio_button_set_property   (GObject             *object,
49                                                  guint                prop_id,
50                                                  const GValue        *value,
51                                                  GParamSpec          *pspec);
52 static void     gtk_radio_button_get_property   (GObject             *object,
53                                                  guint                prop_id,
54                                                  GValue              *value,
55                                                  GParamSpec          *pspec);
56
57 G_DEFINE_TYPE (GtkRadioButton, gtk_radio_button, GTK_TYPE_CHECK_BUTTON)
58
59 static guint group_changed_signal = 0;
60
61 static void
62 gtk_radio_button_class_init (GtkRadioButtonClass *class)
63 {
64   GObjectClass *gobject_class;
65   GtkObjectClass *object_class;
66   GtkButtonClass *button_class;
67   GtkCheckButtonClass *check_button_class;
68   GtkWidgetClass *widget_class;
69
70   gobject_class = G_OBJECT_CLASS (class);
71   object_class = (GtkObjectClass*) class;
72   widget_class = (GtkWidgetClass*) class;
73   button_class = (GtkButtonClass*) class;
74   check_button_class = (GtkCheckButtonClass*) class;
75
76   gobject_class->set_property = gtk_radio_button_set_property;
77   gobject_class->get_property = gtk_radio_button_get_property;
78
79   g_object_class_install_property (gobject_class,
80                                    PROP_GROUP,
81                                    g_param_spec_object ("group",
82                                                         P_("Group"),
83                                                         P_("The radio button whose group this widget belongs to."),
84                                                         GTK_TYPE_RADIO_BUTTON,
85                                                         GTK_PARAM_WRITABLE));
86   object_class->destroy = gtk_radio_button_destroy;
87
88   widget_class->focus = gtk_radio_button_focus;
89
90   button_class->clicked = gtk_radio_button_clicked;
91
92   check_button_class->draw_indicator = gtk_radio_button_draw_indicator;
93
94   class->group_changed = NULL;
95
96   /**
97    * GtkRadioButton::group-changed:
98    * @style: the object which received the signal
99    *
100    * Emitted when the group of radio buttons that a radio button belongs
101    * to changes. This is emitted when a radio button switches from
102    * being alone to being part of a group of 2 or more buttons, or
103    * vice-versa, and when a button is moved from one group of 2 or
104    * more buttons to a different one, but not when the composition
105    * of the group that a button belongs to changes.
106    *
107    * Since: 2.4
108    */
109   group_changed_signal = g_signal_new (I_("group-changed"),
110                                        G_OBJECT_CLASS_TYPE (object_class),
111                                        G_SIGNAL_RUN_FIRST,
112                                        G_STRUCT_OFFSET (GtkRadioButtonClass, group_changed),
113                                        NULL, NULL,
114                                        _gtk_marshal_VOID__VOID,
115                                        G_TYPE_NONE, 0);
116 }
117
118 static void
119 gtk_radio_button_init (GtkRadioButton *radio_button)
120 {
121   GTK_WIDGET_SET_FLAGS (radio_button, GTK_NO_WINDOW);
122   GTK_WIDGET_UNSET_FLAGS (radio_button, GTK_RECEIVES_DEFAULT);
123
124   GTK_TOGGLE_BUTTON (radio_button)->active = TRUE;
125
126   GTK_BUTTON (radio_button)->depress_on_activate = FALSE;
127
128   radio_button->group = g_slist_prepend (NULL, radio_button);
129
130   _gtk_button_set_depressed (GTK_BUTTON (radio_button), TRUE);
131   gtk_widget_set_state (GTK_WIDGET (radio_button), GTK_STATE_ACTIVE);
132 }
133
134 static void
135 gtk_radio_button_set_property (GObject      *object,
136                                guint         prop_id,
137                                const GValue *value,
138                                GParamSpec   *pspec)
139 {
140   GtkRadioButton *radio_button;
141
142   radio_button = GTK_RADIO_BUTTON (object);
143
144   switch (prop_id)
145     {
146       GSList *slist;
147       GtkRadioButton *button;
148
149     case PROP_GROUP:
150         button = g_value_get_object (value);
151
152       if (button)
153         slist = gtk_radio_button_get_group (button);
154       else
155         slist = NULL;
156       gtk_radio_button_set_group (radio_button, slist);
157       break;
158     default:
159       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
160       break;
161     }
162 }
163
164 static void
165 gtk_radio_button_get_property (GObject    *object,
166                                guint       prop_id,
167                                GValue     *value,
168                                GParamSpec *pspec)
169 {
170   switch (prop_id)
171     {
172     default:
173       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
174       break;
175     }
176 }
177
178 void
179 gtk_radio_button_set_group (GtkRadioButton *radio_button,
180                             GSList         *group)
181 {
182   GtkWidget *old_group_singleton = NULL;
183   GtkWidget *new_group_singleton = NULL;
184   
185   g_return_if_fail (GTK_IS_RADIO_BUTTON (radio_button));
186   g_return_if_fail (!g_slist_find (group, radio_button));
187
188   if (radio_button->group)
189     {
190       GSList *slist;
191
192       radio_button->group = g_slist_remove (radio_button->group, radio_button);
193       
194       if (radio_button->group && !radio_button->group->next)
195         old_group_singleton = g_object_ref (radio_button->group->data);
196           
197       for (slist = radio_button->group; slist; slist = slist->next)
198         {
199           GtkRadioButton *tmp_button;
200           
201           tmp_button = slist->data;
202           
203           tmp_button->group = radio_button->group;
204         }
205     }
206   
207   if (group && !group->next)
208     new_group_singleton = g_object_ref (group->data);
209   
210   radio_button->group = g_slist_prepend (group, radio_button);
211   
212   if (group)
213     {
214       GSList *slist;
215       
216       for (slist = group; slist; slist = slist->next)
217         {
218           GtkRadioButton *tmp_button;
219           
220           tmp_button = slist->data;
221           
222           tmp_button->group = radio_button->group;
223         }
224     }
225
226   g_object_ref (radio_button);
227   
228   g_object_notify (G_OBJECT (radio_button), "group");
229   g_signal_emit (radio_button, group_changed_signal, 0);
230   if (old_group_singleton)
231     {
232       g_signal_emit (old_group_singleton, group_changed_signal, 0);
233       g_object_unref (old_group_singleton);
234     }
235   if (new_group_singleton)
236     {
237       g_signal_emit (new_group_singleton, group_changed_signal, 0);
238       g_object_unref (new_group_singleton);
239     }
240
241   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button), group == NULL);
242
243   g_object_unref (radio_button);
244 }
245
246 GtkWidget*
247 gtk_radio_button_new (GSList *group)
248 {
249   GtkRadioButton *radio_button;
250
251   radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, NULL);
252
253   if (group)
254     gtk_radio_button_set_group (radio_button, group);
255
256   return GTK_WIDGET (radio_button);
257 }
258
259 GtkWidget*
260 gtk_radio_button_new_with_label (GSList      *group,
261                                  const gchar *label)
262 {
263   GtkWidget *radio_button;
264
265   radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, "label", label, NULL) ;
266
267   if (group)
268     gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_button), group);
269
270   return radio_button;
271 }
272
273
274 /**
275  * gtk_radio_button_new_with_mnemonic:
276  * @group: the radio button group
277  * @label: the text of the button, with an underscore in front of the
278  *         mnemonic character
279  * @returns: a new #GtkRadioButton
280  *
281  * Creates a new #GtkRadioButton containing a label, adding it to the same 
282  * group as @group. The label will be created using 
283  * gtk_label_new_with_mnemonic(), so underscores in @label indicate the 
284  * mnemonic for the button.
285  **/
286 GtkWidget*
287 gtk_radio_button_new_with_mnemonic (GSList      *group,
288                                     const gchar *label)
289 {
290   GtkWidget *radio_button;
291
292   radio_button = g_object_new (GTK_TYPE_RADIO_BUTTON, 
293                                "label", label, 
294                                "use-underline", TRUE, 
295                                NULL);
296
297   if (group)
298     gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_button), group);
299
300   return radio_button;
301 }
302
303 GtkWidget*
304 gtk_radio_button_new_from_widget (GtkRadioButton *radio_group_member)
305 {
306   GSList *l = NULL;
307   if (radio_group_member)
308     l = gtk_radio_button_get_group (radio_group_member);
309   return gtk_radio_button_new (l);
310 }
311
312
313 GtkWidget*
314 gtk_radio_button_new_with_label_from_widget (GtkRadioButton *radio_group_member,
315                                              const gchar    *label)
316 {
317   GSList *l = NULL;
318   if (radio_group_member)
319     l = gtk_radio_button_get_group (radio_group_member);
320   return gtk_radio_button_new_with_label (l, label);
321 }
322
323 /**
324  * gtk_radio_button_new_with_mnemonic_from_widget:
325  * @radio_group_member: widget to get radio group from or %NULL
326  * @label: the text of the button, with an underscore in front of the
327  *         mnemonic character
328  * @returns: a new #GtkRadioButton
329  *
330  * Creates a new #GtkRadioButton containing a label. The label
331  * will be created using gtk_label_new_with_mnemonic(), so underscores
332  * in @label indicate the mnemonic for the button.
333  **/
334 GtkWidget*
335 gtk_radio_button_new_with_mnemonic_from_widget (GtkRadioButton *radio_group_member,
336                                                 const gchar    *label)
337 {
338   GSList *l = NULL;
339   if (radio_group_member)
340     l = gtk_radio_button_get_group (radio_group_member);
341   return gtk_radio_button_new_with_mnemonic (l, label);
342 }
343
344 GSList*
345 gtk_radio_button_get_group (GtkRadioButton *radio_button)
346 {
347   g_return_val_if_fail (GTK_IS_RADIO_BUTTON (radio_button), NULL);
348
349   return radio_button->group;
350 }
351
352
353 static void
354 gtk_radio_button_destroy (GtkObject *object)
355 {
356   GtkWidget *old_group_singleton = NULL;
357   GtkRadioButton *radio_button;
358   GtkRadioButton *tmp_button;
359   GSList *tmp_list;
360   gboolean was_in_group;
361   
362   radio_button = GTK_RADIO_BUTTON (object);
363
364   was_in_group = radio_button->group && radio_button->group->next;
365   
366   radio_button->group = g_slist_remove (radio_button->group, radio_button);
367   if (radio_button->group && !radio_button->group->next)
368     old_group_singleton = radio_button->group->data;
369
370   tmp_list = radio_button->group;
371
372   while (tmp_list)
373     {
374       tmp_button = tmp_list->data;
375       tmp_list = tmp_list->next;
376
377       tmp_button->group = radio_button->group;
378     }
379
380   /* this button is no longer in the group */
381   radio_button->group = NULL;
382
383   if (old_group_singleton)
384     g_signal_emit (old_group_singleton, group_changed_signal, 0);
385   if (was_in_group)
386     g_signal_emit (radio_button, group_changed_signal, 0);
387
388   GTK_OBJECT_CLASS (gtk_radio_button_parent_class)->destroy (object);
389 }
390
391 static void
392 get_coordinates (GtkWidget    *widget,
393                  GtkWidget    *reference,
394                  gint         *x,
395                  gint         *y)
396 {
397   *x = widget->allocation.x + widget->allocation.width / 2;
398   *y = widget->allocation.y + widget->allocation.height / 2;
399   
400   gtk_widget_translate_coordinates (widget, reference, *x, *y, x, y);
401 }
402
403 static gint
404 left_right_compare (gconstpointer a,
405                     gconstpointer b,
406                     gpointer      data)
407 {
408   gint x1, y1, x2, y2;
409
410   get_coordinates ((GtkWidget *)a, data, &x1, &y1);
411   get_coordinates ((GtkWidget *)b, data, &x2, &y2);
412
413   if (y1 == y2)
414     return (x1 < x2) ? -1 : ((x1 == x2) ? 0 : 1);
415   else
416     return (y1 < y2) ? -1 : 1;
417 }
418
419 static gint
420 up_down_compare (gconstpointer a,
421                  gconstpointer b,
422                  gpointer      data)
423 {
424   gint x1, y1, x2, y2;
425   
426   get_coordinates ((GtkWidget *)a, data, &x1, &y1);
427   get_coordinates ((GtkWidget *)b, data, &x2, &y2);
428   
429   if (x1 == x2)
430     return (y1 < y2) ? -1 : ((y1 == y2) ? 0 : 1);
431   else
432     return (x1 < x2) ? -1 : 1;
433 }
434
435 static gboolean
436 gtk_radio_button_focus (GtkWidget         *widget,
437                         GtkDirectionType   direction)
438 {
439   GtkRadioButton *radio_button = GTK_RADIO_BUTTON (widget);
440   GSList *tmp_slist;
441
442   /* Radio buttons with draw_indicator unset focus "normally", since
443    * they look like buttons to the user.
444    */
445   if (!GTK_TOGGLE_BUTTON (widget)->draw_indicator)
446     return GTK_WIDGET_CLASS (gtk_radio_button_parent_class)->focus (widget, direction);
447   
448   if (gtk_widget_is_focus (widget))
449     {
450       GtkSettings *settings = gtk_widget_get_settings (widget);
451       GSList *focus_list, *tmp_list;
452       GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
453       GtkWidget *new_focus = NULL;
454       gboolean cursor_only;
455       gboolean wrap_around;
456
457       switch (direction)
458         {
459         case GTK_DIR_LEFT:
460         case GTK_DIR_RIGHT:
461           focus_list = g_slist_copy (radio_button->group);
462           focus_list = g_slist_sort_with_data (focus_list, left_right_compare, toplevel);
463           break;
464         case GTK_DIR_UP:
465         case GTK_DIR_DOWN:
466           focus_list = g_slist_copy (radio_button->group);
467           focus_list = g_slist_sort_with_data (focus_list, up_down_compare, toplevel);
468           break;
469         case GTK_DIR_TAB_FORWARD:
470         case GTK_DIR_TAB_BACKWARD:
471           /* fall through */
472         default:
473           return FALSE;
474         }
475
476       if (direction == GTK_DIR_LEFT || direction == GTK_DIR_UP)
477         focus_list = g_slist_reverse (focus_list);
478
479       tmp_list = g_slist_find (focus_list, widget);
480
481       if (tmp_list)
482         {
483           tmp_list = tmp_list->next;
484           
485           while (tmp_list)
486             {
487               GtkWidget *child = tmp_list->data;
488               
489               if (GTK_WIDGET_MAPPED (child) && GTK_WIDGET_IS_SENSITIVE (child))
490                 {
491                   new_focus = child;
492                   break;
493                 }
494
495               tmp_list = tmp_list->next;
496             }
497         }
498
499       g_object_get (settings,
500                     "gtk-keynav-cursor-only", &cursor_only,
501                     "gtk-keynav-wrap-around", &wrap_around,
502                     NULL);
503
504       if (!new_focus)
505         {
506           if (cursor_only)
507             {
508               g_slist_free (focus_list);
509               return FALSE;
510             }
511
512           if (!wrap_around)
513             {
514               g_slist_free (focus_list);
515               gtk_widget_error_bell (widget);
516               return TRUE;
517             }
518
519           tmp_list = focus_list;
520
521           while (tmp_list)
522             {
523               GtkWidget *child = tmp_list->data;
524               
525               if (GTK_WIDGET_MAPPED (child) && GTK_WIDGET_IS_SENSITIVE (child))
526                 {
527                   new_focus = child;
528                   break;
529                 }
530               
531               tmp_list = tmp_list->next;
532             }
533         }
534       
535       g_slist_free (focus_list);
536
537       if (new_focus)
538         {
539           gtk_widget_grab_focus (new_focus);
540
541           if (!cursor_only)
542             gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE);
543         }
544
545       return TRUE;
546     }
547   else
548     {
549       GtkRadioButton *selected_button = NULL;
550       
551       /* We accept the focus if, we don't have the focus and
552        *  - we are the currently active button in the group
553        *  - there is no currently active radio button.
554        */
555       
556       tmp_slist = radio_button->group;
557       while (tmp_slist)
558         {
559           if (GTK_TOGGLE_BUTTON (tmp_slist->data)->active)
560             selected_button = tmp_slist->data;
561           tmp_slist = tmp_slist->next;
562         }
563       
564       if (selected_button && selected_button != radio_button)
565         return FALSE;
566
567       gtk_widget_grab_focus (widget);
568       return TRUE;
569     }
570 }
571
572 static void
573 gtk_radio_button_clicked (GtkButton *button)
574 {
575   GtkToggleButton *toggle_button;
576   GtkRadioButton *radio_button;
577   GtkToggleButton *tmp_button;
578   GtkStateType new_state;
579   GSList *tmp_list;
580   gint toggled;
581   gboolean depressed;
582
583   radio_button = GTK_RADIO_BUTTON (button);
584   toggle_button = GTK_TOGGLE_BUTTON (button);
585   toggled = FALSE;
586
587   g_object_ref (GTK_WIDGET (button));
588
589   if (toggle_button->active)
590     {
591       tmp_button = NULL;
592       tmp_list = radio_button->group;
593
594       while (tmp_list)
595         {
596           tmp_button = tmp_list->data;
597           tmp_list = tmp_list->next;
598
599           if (tmp_button->active && tmp_button != toggle_button)
600             break;
601
602           tmp_button = NULL;
603         }
604
605       if (!tmp_button)
606         {
607           new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
608         }
609       else
610         {
611           toggled = TRUE;
612           toggle_button->active = !toggle_button->active;
613           new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL);
614         }
615     }
616   else
617     {
618       toggled = TRUE;
619       toggle_button->active = !toggle_button->active;
620       
621       tmp_list = radio_button->group;
622       while (tmp_list)
623         {
624           tmp_button = tmp_list->data;
625           tmp_list = tmp_list->next;
626
627           if (tmp_button->active && (tmp_button != toggle_button))
628             {
629               gtk_button_clicked (GTK_BUTTON (tmp_button));
630               break;
631             }
632         }
633
634       new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
635     }
636
637   if (toggle_button->inconsistent)
638     depressed = FALSE;
639   else if (button->in_button && button->button_down)
640     depressed = !toggle_button->active;
641   else
642     depressed = toggle_button->active;
643
644   if (GTK_WIDGET_STATE (button) != new_state)
645     gtk_widget_set_state (GTK_WIDGET (button), new_state);
646
647   if (toggled)
648     {
649       gtk_toggle_button_toggled (toggle_button);
650
651       g_object_notify (G_OBJECT (toggle_button), "active");
652     }
653
654   _gtk_button_set_depressed (button, depressed);
655
656   gtk_widget_queue_draw (GTK_WIDGET (button));
657
658   g_object_unref (button);
659 }
660
661 static void
662 gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
663                                  GdkRectangle   *area)
664 {
665   GtkWidget *widget;
666   GtkWidget *child;
667   GtkButton *button;
668   GtkToggleButton *toggle_button;
669   GtkStateType state_type;
670   GtkShadowType shadow_type;
671   gint x, y;
672   gint indicator_size, indicator_spacing;
673   gint focus_width;
674   gint focus_pad;
675   gboolean interior_focus;
676
677   if (GTK_WIDGET_DRAWABLE (check_button))
678     {
679       widget = GTK_WIDGET (check_button);
680       button = GTK_BUTTON (check_button);
681       toggle_button = GTK_TOGGLE_BUTTON (check_button);
682
683       gtk_widget_style_get (widget,
684                             "interior-focus", &interior_focus,
685                             "focus-line-width", &focus_width,
686                             "focus-padding", &focus_pad,
687                             NULL);
688
689       _gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing);
690
691       x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width;
692       y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
693
694       child = GTK_BIN (check_button)->child;
695       if (!interior_focus || !(child && GTK_WIDGET_VISIBLE (child)))
696         x += focus_width + focus_pad;      
697
698       if (toggle_button->inconsistent)
699         shadow_type = GTK_SHADOW_ETCHED_IN;
700       else if (toggle_button->active)
701         shadow_type = GTK_SHADOW_IN;
702       else
703         shadow_type = GTK_SHADOW_OUT;
704
705       if (button->activate_timeout || (button->button_down && button->in_button))
706         state_type = GTK_STATE_ACTIVE;
707       else if (button->in_button)
708         state_type = GTK_STATE_PRELIGHT;
709       else if (!GTK_WIDGET_IS_SENSITIVE (widget))
710         state_type = GTK_STATE_INSENSITIVE;
711       else
712         state_type = GTK_STATE_NORMAL;
713
714       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
715         x = widget->allocation.x + widget->allocation.width - (indicator_size + x - widget->allocation.x);
716
717       if (GTK_WIDGET_STATE (toggle_button) == GTK_STATE_PRELIGHT)
718         {
719           GdkRectangle restrict_area;
720           GdkRectangle new_area;
721               
722           restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
723           restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
724           restrict_area.width = widget->allocation.width - (2 * GTK_CONTAINER (widget)->border_width);
725           restrict_area.height = widget->allocation.height - (2 * GTK_CONTAINER (widget)->border_width);
726           
727           if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
728             {
729               gtk_paint_flat_box (widget->style, widget->window, GTK_STATE_PRELIGHT,
730                                   GTK_SHADOW_ETCHED_OUT, 
731                                   area, widget, "checkbutton",
732                                   new_area.x, new_area.y,
733                                   new_area.width, new_area.height);
734             }
735         }
736
737       gtk_paint_option (widget->style, widget->window,
738                         state_type, shadow_type,
739                         area, widget, "radiobutton",
740                         x, y, indicator_size, indicator_size);
741     }
742 }
743
744 #define __GTK_RADIO_BUTTON_C__
745 #include "gtkaliasdef.c"