Re: mnemonic labels (was Re: Remove spaces in dialog window)

Beast said:
muppet wrote:
You can set the label to be the mnemonic for another widget.

   # new() is aliased to new_with_mnemonic() in the perl bindings:
   $label = Gtk2::Label->new ('_User Name');
   $entry = Gtk2::Entry->new;
   # set $label to be the mnemonic for $entry
   $label->set_mnemonic_for ($entry);

It seems does not work with my version of perl-gtk

*** unhandled exception in callback:
***   Can't locate object method "set_mnemonic_for" via package
"Gtk2::Label" at line 35, <DATA> line 225.
***  ignoring at ./ line 10, <DATA> line 225.

My mistake --- it should be

  $label->set_mnemonic_widget ($entry);

I also need to use new_with_mnemonic instead of just new();

Right again.

I apologize -- i hadn't had my caffeine yet.  :-(

muppet <scott at asofyet dot org>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]