Guy Harris wrote:
 
[...]
> If it's the latter, the way I've done that in Ethereal for buttons is
> to, in the routine that creates the dialog box:
> 
>    allocate a GtkAccelGroup, and add it to the window with
>    "gtk_window_add_accel_group()";
> 
>    copy routines such as "gtk_radio_button_new_with_label()" and
>    modify them to:
>
>       take an additional argument, which is a pointer to the
>       GtkAccelGroup;
> 
>       pass the label widget and the label string for the label
>       to "gtk_label_parse_uline()", and, if the return value
>       isn't GDK_VoidSymbol, add to the GtkAccelGroup accelerators for
>       the key returned by "gtk_label_parse_uline()" and for
>       that key with GDK_MOD1_MASK (that's the mask for the Alt
>       key), and have that accelerator deliver a "clicked"
>       signal to the button.
> 
> Making it easier to do this might be something worth considering for
> GTK+ 1.4, especially with the changes Havoc's been making to beef up the
> GtkDialog widget.
Hi, is it really necessary to copy and edit the Gtk methods - I am probably
missing something but I don't see the need for a new constructor.

Why is it not possible to do (eg in Perl)?

  $rb = new Gtk::RadioButton(_('ra_diobutton5'), $rb-group );
  $key = $rb->child->parse_uline(_('ra_diobutton5') );
  $rb->add_accelerator('clicked', $accelgroup}, $key, 'mod1_mask',
      ['visible', 'locked'] );

which will add the Alt-d (in english) or whatever else is specified in the
translation files.

Regards, Dermot

-- 
To unsubscribe: mail -s unsubscribe [EMAIL PROTECTED] < /dev/null

Reply via email to