]> Pileus Git - ~andy/gtk/blob - gtk/gtkaccellabel.c
Improve translators comments. (#389298, Christian Persch)
[~andy/gtk] / gtk / gtkaccellabel.c
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * GtkAccelLabel: GtkLabel with accelerator monitoring facilities.
5  * Copyright (C) 1998 Tim Janik
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 /*
24  * Modified by the GTK+ Team and others 1997-2001.  See the AUTHORS
25  * file for a list of people on the GTK+ Team.  See the ChangeLog
26  * files for a list of changes.  These files are distributed with
27  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
28  */
29
30 #include <config.h>
31 #include <string.h>
32
33 #include "gtkaccellabel.h"
34 #include "gtkaccelmap.h"
35 #include "gtkmain.h"
36 #include "gtkprivate.h"
37 #include "gtkintl.h"
38 #include "gtkalias.h"
39
40 enum {
41   PROP_0,
42   PROP_ACCEL_CLOSURE,
43   PROP_ACCEL_WIDGET
44 };
45
46 static void         gtk_accel_label_set_property (GObject            *object,
47                                                   guint               prop_id,
48                                                   const GValue       *value,
49                                                   GParamSpec         *pspec);
50 static void         gtk_accel_label_get_property (GObject            *object,
51                                                   guint               prop_id,
52                                                   GValue             *value,
53                                                   GParamSpec         *pspec);
54 static void         gtk_accel_label_destroy      (GtkObject          *object);
55 static void         gtk_accel_label_finalize     (GObject            *object);
56 static void         gtk_accel_label_size_request (GtkWidget          *widget,
57                                                   GtkRequisition     *requisition);
58 static gboolean     gtk_accel_label_expose_event (GtkWidget          *widget,
59                                                   GdkEventExpose     *event);
60 static const gchar *gtk_accel_label_get_string   (GtkAccelLabel      *accel_label);
61
62
63 G_DEFINE_TYPE (GtkAccelLabel, gtk_accel_label, GTK_TYPE_LABEL)
64
65 static void
66 gtk_accel_label_class_init (GtkAccelLabelClass *class)
67 {
68   GObjectClass *gobject_class = G_OBJECT_CLASS (class);
69   GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
70   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
71   
72   gobject_class->finalize = gtk_accel_label_finalize;
73   gobject_class->set_property = gtk_accel_label_set_property;
74   gobject_class->get_property = gtk_accel_label_get_property;
75   
76   object_class->destroy = gtk_accel_label_destroy;
77    
78   widget_class->size_request = gtk_accel_label_size_request;
79   widget_class->expose_event = gtk_accel_label_expose_event;
80
81   class->signal_quote1 = g_strdup ("<:");
82   class->signal_quote2 = g_strdup (":>");
83   /* This is the text that should appear next to menu accelerators
84    * that use the shift key. If the text on this key isn't typically
85    * translated on keyboards used for your language, don't translate
86    * this.
87    * 
88    * Don't include the prefix "keyboard label|" in the translation.
89    */
90   class->mod_name_shift = g_strdup (Q_("keyboard label|Shift"));
91   /* This is the text that should appear next to menu accelerators
92    * that use the control key. If the text on this key isn't typically
93    * translated on keyboards used for your language, don't translate
94    * this.
95    *
96    * Don't include the prefix "keyboard label|" in the translation.
97    */
98   class->mod_name_control = g_strdup (Q_("keyboard label|Ctrl"));
99   /* This is the text that should appear next to menu accelerators
100    * that use the alt key. If the text on this key isn't typically
101    * translated on keyboards used for your language, don't translate
102    * this.
103    *
104    * Don't include the prefix "keyboard label|" in the translation.
105    */
106   class->mod_name_alt = g_strdup (Q_("keyboard label|Alt"));
107   class->mod_separator = g_strdup ("+");
108   class->accel_seperator = g_strdup (" / ");
109   class->latin1_to_char = TRUE;
110   
111   g_object_class_install_property (gobject_class,
112                                    PROP_ACCEL_CLOSURE,
113                                    g_param_spec_boxed ("accel-closure",
114                                                        P_("Accelerator Closure"),
115                                                        P_("The closure to be monitored for accelerator changes"),
116                                                        G_TYPE_CLOSURE,
117                                                        GTK_PARAM_READWRITE));
118   g_object_class_install_property (gobject_class,
119                                    PROP_ACCEL_WIDGET,
120                                    g_param_spec_object ("accel-widget",
121                                                         P_("Accelerator Widget"),
122                                                         P_("The widget to be monitored for accelerator changes"),
123                                                         GTK_TYPE_WIDGET,
124                                                         GTK_PARAM_READWRITE));
125 }
126
127 static void
128 gtk_accel_label_set_property (GObject      *object,
129                               guint         prop_id,
130                               const GValue *value,
131                               GParamSpec   *pspec)
132 {
133   GtkAccelLabel  *accel_label;
134
135   accel_label = GTK_ACCEL_LABEL (object);
136
137   switch (prop_id)
138     {
139     case PROP_ACCEL_CLOSURE:
140       gtk_accel_label_set_accel_closure (accel_label, g_value_get_boxed (value));
141       break;
142     case PROP_ACCEL_WIDGET:
143       gtk_accel_label_set_accel_widget (accel_label, g_value_get_object (value));
144       break;
145     default:
146       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
147       break;
148     }
149 }
150
151 static void
152 gtk_accel_label_get_property (GObject    *object,
153                               guint       prop_id,
154                               GValue     *value,
155                               GParamSpec *pspec)
156 {
157   GtkAccelLabel  *accel_label;
158
159   accel_label = GTK_ACCEL_LABEL (object);
160
161   switch (prop_id)
162     {
163     case PROP_ACCEL_CLOSURE:
164       g_value_set_boxed (value, accel_label->accel_closure);
165       break;
166     case PROP_ACCEL_WIDGET:
167       g_value_set_object (value, accel_label->accel_widget);
168       break;
169     default:
170       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
171       break;
172     }
173 }
174
175 static void
176 gtk_accel_label_init (GtkAccelLabel *accel_label)
177 {
178   accel_label->accel_padding = 3;
179   accel_label->accel_widget = NULL;
180   accel_label->accel_closure = NULL;
181   accel_label->accel_group = NULL;
182   accel_label->accel_string = NULL;
183 }
184
185 GtkWidget*
186 gtk_accel_label_new (const gchar *string)
187 {
188   GtkAccelLabel *accel_label;
189   
190   g_return_val_if_fail (string != NULL, NULL);
191   
192   accel_label = g_object_new (GTK_TYPE_ACCEL_LABEL, NULL);
193   
194   gtk_label_set_text (GTK_LABEL (accel_label), string);
195   
196   return GTK_WIDGET (accel_label);
197 }
198
199 static void
200 gtk_accel_label_destroy (GtkObject *object)
201 {
202   GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (object);
203
204   gtk_accel_label_set_accel_widget (accel_label, NULL);
205   gtk_accel_label_set_accel_closure (accel_label, NULL);
206   
207   GTK_OBJECT_CLASS (gtk_accel_label_parent_class)->destroy (object);
208 }
209
210 static void
211 gtk_accel_label_finalize (GObject *object)
212 {
213   GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (object);
214
215   g_free (accel_label->accel_string);
216   
217   G_OBJECT_CLASS (gtk_accel_label_parent_class)->finalize (object);
218 }
219
220 /**
221  * gtk_accel_label_get_accel_widget:
222  * @accel_label: a #GtkAccelLabel
223  *
224  * Fetches the widget monitored by this accelerator label. See
225  * gtk_accel_label_set_accel_widget().
226  *
227  * Return value: the object monitored by the accelerator label,
228  *               or %NULL.
229  **/
230 GtkWidget*
231 gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label)
232 {
233   g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), NULL);
234
235   return accel_label->accel_widget;
236 }
237
238 guint
239 gtk_accel_label_get_accel_width (GtkAccelLabel *accel_label)
240 {
241   g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), 0);
242   
243   return (accel_label->accel_string_width +
244           (accel_label->accel_string_width ? accel_label->accel_padding : 0));
245 }
246
247 static void
248 gtk_accel_label_size_request (GtkWidget      *widget,
249                               GtkRequisition *requisition)
250 {
251   GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (widget);
252   PangoLayout *layout;
253   gint width;
254   
255   if (GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->size_request)
256     GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->size_request (widget, requisition);
257
258   layout = gtk_widget_create_pango_layout (widget, gtk_accel_label_get_string (accel_label));
259   pango_layout_get_pixel_size (layout, &width, NULL);
260   accel_label->accel_string_width = width;
261   
262   g_object_unref (layout);
263 }
264
265 static gint
266 get_first_baseline (PangoLayout *layout)
267 {
268   PangoLayoutIter *iter;
269   gint result;
270
271   iter = pango_layout_get_iter (layout);
272   result = pango_layout_iter_get_baseline (iter);
273   pango_layout_iter_free (iter);
274
275   return PANGO_PIXELS (result);
276 }
277
278 static gboolean 
279 gtk_accel_label_expose_event (GtkWidget      *widget,
280                               GdkEventExpose *event)
281 {
282   GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (widget);
283   GtkMisc *misc = GTK_MISC (accel_label);
284   GtkTextDirection direction;
285
286   direction = gtk_widget_get_direction (widget);
287
288   if (GTK_WIDGET_DRAWABLE (accel_label))
289     {
290       guint ac_width;
291       
292       ac_width = gtk_accel_label_get_accel_width (accel_label);
293       
294       if (widget->allocation.width >= widget->requisition.width + ac_width)
295         {
296           PangoLayout *label_layout;
297           PangoLayout *accel_layout;
298           GtkLabel *label = GTK_LABEL (widget);
299
300           gint x;
301           gint y;
302           
303           label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
304
305           if (direction == GTK_TEXT_DIR_RTL)
306             widget->allocation.x += ac_width;
307           widget->allocation.width -= ac_width;
308           if (gtk_label_get_ellipsize (label))
309             pango_layout_set_width (label_layout,
310                                     pango_layout_get_width (label_layout) 
311                                     - ac_width * PANGO_SCALE);
312           
313           if (GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->expose_event)
314             GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->expose_event (widget, event);
315           if (direction == GTK_TEXT_DIR_RTL)
316             widget->allocation.x -= ac_width;
317           widget->allocation.width += ac_width;
318           if (gtk_label_get_ellipsize (label))
319             pango_layout_set_width (label_layout,
320                                     pango_layout_get_width (label_layout) 
321                                     + ac_width * PANGO_SCALE);
322           
323           if (direction == GTK_TEXT_DIR_RTL)
324             x = widget->allocation.x + misc->xpad;
325           else
326             x = widget->allocation.x + widget->allocation.width - misc->xpad - ac_width;
327
328           gtk_label_get_layout_offsets (GTK_LABEL (accel_label), NULL, &y);
329
330           accel_layout = gtk_widget_create_pango_layout (widget, gtk_accel_label_get_string (accel_label));
331
332           y += get_first_baseline (label_layout) - get_first_baseline (accel_layout);
333
334           gtk_paint_layout (widget->style,
335                             widget->window,
336                             GTK_WIDGET_STATE (widget),
337                             FALSE,
338                             &event->area,
339                             widget,
340                             "accellabel",
341                             x, y,
342                             accel_layout);                            
343
344           g_object_unref (accel_layout);
345         }
346       else
347         {
348           if (GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->expose_event)
349             GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->expose_event (widget, event);
350         }
351     }
352   
353   return FALSE;
354 }
355
356 static void
357 refetch_widget_accel_closure (GtkAccelLabel *accel_label)
358 {
359   GClosure *closure = NULL;
360   GList *clist, *list;
361   
362   g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label));
363   g_return_if_fail (GTK_IS_WIDGET (accel_label->accel_widget));
364   
365   clist = gtk_widget_list_accel_closures (accel_label->accel_widget);
366   for (list = clist; list; list = list->next)
367     {
368       /* we just take the first closure used */
369       closure = list->data;
370       break;
371     }
372   g_list_free (clist);
373   gtk_accel_label_set_accel_closure (accel_label, closure);
374 }
375
376 /**
377  * gtk_accel_label_set_accel_widget:
378  * @accel_label: a #GtkAccelLabel
379  * @accel_widget: the widget to be monitored.
380  *
381  * Sets the widget to be monitored by this accelerator label. 
382  **/
383 void
384 gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label,
385                                   GtkWidget     *accel_widget)
386 {
387   g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label));
388   if (accel_widget)
389     g_return_if_fail (GTK_IS_WIDGET (accel_widget));
390     
391   if (accel_widget != accel_label->accel_widget)
392     {
393       if (accel_label->accel_widget)
394         {
395           gtk_accel_label_set_accel_closure (accel_label, NULL);
396           g_signal_handlers_disconnect_by_func (accel_label->accel_widget,
397                                                 refetch_widget_accel_closure,
398                                                 accel_label);
399           g_object_unref (accel_label->accel_widget);
400         }
401       accel_label->accel_widget = accel_widget;
402       if (accel_label->accel_widget)
403         {
404           g_object_ref (accel_label->accel_widget);
405           g_signal_connect_object (accel_label->accel_widget, "accel_closures_changed",
406                                    G_CALLBACK (refetch_widget_accel_closure),
407                                    accel_label, G_CONNECT_SWAPPED);
408           refetch_widget_accel_closure (accel_label);
409         }
410       g_object_notify (G_OBJECT (accel_label), "accel-widget");
411     }
412 }
413
414 static void
415 gtk_accel_label_reset (GtkAccelLabel *accel_label)
416 {
417   if (accel_label->accel_string)
418     {
419       g_free (accel_label->accel_string);
420       accel_label->accel_string = NULL;
421     }
422   
423   gtk_widget_queue_resize (GTK_WIDGET (accel_label));
424 }
425
426 static void
427 check_accel_changed (GtkAccelGroup  *accel_group,
428                      guint           keyval,
429                      GdkModifierType modifier,
430                      GClosure       *accel_closure,
431                      GtkAccelLabel  *accel_label)
432 {
433   if (accel_closure == accel_label->accel_closure)
434     gtk_accel_label_reset (accel_label);
435 }
436
437 /**
438  * gtk_accel_label_set_accel_closure:
439  * @accel_label: a #GtkAccelLabel
440  * @accel_closure: the closure to monitor for accelerator changes.
441  *
442  * Sets the closure to be monitored by this accelerator label. The closure
443  * must be connected to an accelerator group; see gtk_accel_group_connect().
444  **/
445 void
446 gtk_accel_label_set_accel_closure (GtkAccelLabel *accel_label,
447                                    GClosure      *accel_closure)
448 {
449   g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label));
450   if (accel_closure)
451     g_return_if_fail (gtk_accel_group_from_accel_closure (accel_closure) != NULL);
452
453   if (accel_closure != accel_label->accel_closure)
454     {
455       if (accel_label->accel_closure)
456         {
457           g_signal_handlers_disconnect_by_func (accel_label->accel_group,
458                                                 check_accel_changed,
459                                                 accel_label);
460           accel_label->accel_group = NULL;
461           g_closure_unref (accel_label->accel_closure);
462         }
463       accel_label->accel_closure = accel_closure;
464       if (accel_label->accel_closure)
465         {
466           g_closure_ref (accel_label->accel_closure);
467           accel_label->accel_group = gtk_accel_group_from_accel_closure (accel_closure);
468           g_signal_connect_object (accel_label->accel_group, "accel_changed",
469                                    G_CALLBACK (check_accel_changed),
470                                    accel_label, 0);
471         }
472       gtk_accel_label_reset (accel_label);
473       g_object_notify (G_OBJECT (accel_label), "accel-closure");
474     }
475 }
476
477 static gboolean
478 find_accel (GtkAccelKey *key,
479             GClosure    *closure,
480             gpointer     data)
481 {
482   return data == (gpointer) closure;
483 }
484
485 static const gchar *
486 gtk_accel_label_get_string (GtkAccelLabel *accel_label)
487 {
488   if (!accel_label->accel_string)
489     gtk_accel_label_refetch (accel_label);
490   
491   return accel_label->accel_string;
492 }
493
494 /* Underscores in key names are better displayed as spaces
495  * E.g., Page_Up should be "Page Up"
496  */
497 static void
498 substitute_underscores (char *str)
499 {
500   char *p;
501
502   for (p = str; *p; p++)
503     if (*p == '_')
504       *p = ' ';
505 }
506
507 gchar *
508 _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
509                                               guint               accelerator_key,
510                                               GdkModifierType     accelerator_mods)
511 {
512   GString *gstring;
513   gboolean seen_mod = FALSE;
514   gunichar ch;
515   
516   gstring = g_string_new ("");
517   
518   if (accelerator_mods & GDK_SHIFT_MASK)
519     {
520       g_string_append (gstring, klass->mod_name_shift);
521       seen_mod = TRUE;
522     }
523   if (accelerator_mods & GDK_CONTROL_MASK)
524     {
525       if (seen_mod)
526         g_string_append (gstring, klass->mod_separator);
527       g_string_append (gstring, klass->mod_name_control);
528       seen_mod = TRUE;
529     }
530   if (accelerator_mods & GDK_MOD1_MASK)
531     {
532       if (seen_mod)
533         g_string_append (gstring, klass->mod_separator);
534       g_string_append (gstring, klass->mod_name_alt);
535       seen_mod = TRUE;
536     }
537   if (accelerator_mods & GDK_MOD2_MASK)
538     {
539       if (seen_mod)
540         g_string_append (gstring, klass->mod_separator);
541
542       g_string_append (gstring, "Mod2");
543       seen_mod = TRUE;
544     }
545   if (accelerator_mods & GDK_MOD3_MASK)
546     {
547       if (seen_mod)
548         g_string_append (gstring, klass->mod_separator);
549
550       g_string_append (gstring, "Mod3");
551       seen_mod = TRUE;
552     }
553   if (accelerator_mods & GDK_MOD4_MASK)
554     {
555       if (seen_mod)
556         g_string_append (gstring, klass->mod_separator);
557
558       g_string_append (gstring, "Mod4");
559       seen_mod = TRUE;
560     }
561   if (accelerator_mods & GDK_MOD5_MASK)
562     {
563       if (seen_mod)
564         g_string_append (gstring, klass->mod_separator);
565
566       g_string_append (gstring, "Mod5");
567       seen_mod = TRUE;
568     }
569   if (accelerator_mods & GDK_SUPER_MASK)
570     {
571       if (seen_mod)
572         g_string_append (gstring, klass->mod_separator);
573
574       /* This is the text that should appear next to menu accelerators
575        * that use the super key. If the text on this key isn't typically
576        * translated on keyboards used for your language, don't translate
577        * this.
578        * And do not translate the part before the |.
579        */
580       g_string_append (gstring, Q_("keyboard label|Super"));
581       seen_mod = TRUE;
582     }
583   if (accelerator_mods & GDK_HYPER_MASK)
584     {
585       if (seen_mod)
586         g_string_append (gstring, klass->mod_separator);
587
588       /* This is the text that should appear next to menu accelerators
589        * that use the hyper key. If the text on this key isn't typically
590        * translated on keyboards used for your language, don't translate
591        * this.
592        * And do not translate the part before the |.
593        */
594       g_string_append (gstring, Q_("keyboard label|Hyper"));
595       seen_mod = TRUE;
596     }
597   if (accelerator_mods & GDK_META_MASK)
598     {
599       if (seen_mod)
600         g_string_append (gstring, klass->mod_separator);
601
602       /* This is the text that should appear next to menu accelerators
603        * that use the meta key. If the text on this key isn't typically
604        * translated on keyboards used for your language, don't translate
605        * this.
606        * And do not translate the part before the |.
607        */
608       g_string_append (gstring, Q_("keyboard label|Meta"));
609       seen_mod = TRUE;
610     }
611   if (seen_mod)
612     g_string_append (gstring, klass->mod_separator);
613   
614   ch = gdk_keyval_to_unicode (accelerator_key);
615   if (ch && (g_unichar_isgraph (ch) || ch == ' ') &&
616       (ch < 0x80 || klass->latin1_to_char))
617     {
618       switch (ch)
619         {
620         case ' ':
621           /* do not translate the part before the | */
622           g_string_append (gstring, Q_("keyboard label|Space"));
623           break;
624         case '\\':
625           /* do not translate the part before the | */
626           g_string_append (gstring, Q_("keyboard label|Backslash"));
627           break;
628         default:
629           g_string_append_unichar (gstring, g_unichar_toupper (ch));
630           break;
631         }
632     }
633   else
634     {
635       gchar *tmp;
636
637       tmp = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));
638       if (tmp != NULL)
639         {
640           if (tmp[0] != 0 && tmp[1] == 0)
641             g_string_append_c (gstring, g_ascii_toupper (tmp[0]));
642           else
643             {
644               gchar msg[128];
645               gchar *str;
646               
647               strcpy (msg, "keyboard label|");
648               g_strlcat (msg, tmp, 128);
649               str = dgettext (GETTEXT_PACKAGE, msg);
650               if (str == msg)
651                 {
652                   g_string_append (gstring, tmp);
653                   substitute_underscores (gstring->str);
654                 }
655               else
656                 g_string_append (gstring, str);
657             }
658         }
659     }
660
661   return g_string_free (gstring, FALSE);
662 }
663
664 gboolean
665 gtk_accel_label_refetch (GtkAccelLabel *accel_label)
666 {
667   g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), FALSE);
668
669   if (accel_label->accel_string)
670     {
671       g_free (accel_label->accel_string);
672       accel_label->accel_string = NULL;
673     }
674
675   if (accel_label->accel_closure)
676     {
677       GtkAccelKey *key = gtk_accel_group_find (accel_label->accel_group, find_accel, accel_label->accel_closure);
678
679       if (key && key->accel_flags & GTK_ACCEL_VISIBLE)
680         {
681           GtkAccelLabelClass *klass;
682           gchar *tmp;
683
684           klass = GTK_ACCEL_LABEL_GET_CLASS (accel_label);
685           tmp = _gtk_accel_label_class_get_accelerator_label (klass,
686                                                               key->accel_key,
687                                                               key->accel_mods);
688           accel_label->accel_string = g_strconcat ("   ", tmp, NULL);
689           g_free (tmp);
690         }
691       if (!accel_label->accel_string)
692         accel_label->accel_string = g_strdup ("-/-");
693     }
694   
695   if (!accel_label->accel_string)
696     accel_label->accel_string = g_strdup ("");
697
698   gtk_widget_queue_resize (GTK_WIDGET (accel_label));
699
700   return FALSE;
701 }
702
703 #define __GTK_ACCEL_LABEL_C__
704 #include "gtkaliasdef.c"