On Wed, 2007-07-25 at 16:29 +0300, Veli-Pekka Tätilä wrote:
> Hi list,
> I think I've found a bug or oddity in Win32::GUI::AcceleratorTable
> ...

Yes, right now only the internal handlers are stored in the associated
window, a bug IMHO.

BTW the same happens with a menu.

As time permits I've be working in a proper fix, but as a quick
workaround in my apps I store the perl objects in the window hash:


sub CreateAll {
  my $menu = Win32::GUI::MakeMenu(...);
  my $accel = Win32::GUI::AcceleratorTable->new(...);
  my $rootWin = Win32::GUI::Window->new(
      ...
      -menu => $menu,
      -accel => $accel,
      ...
  );
  # Workaround for window not storing the perl object.
  # I use the '_' prefix to avoid name clashes with child's named
  $rootWin->{_Menu} = $menu;
  $rootWin->{_Accel} = $accel;
  ...
  return $rootWin;
}


-- 
Salvador Ortiz García <[EMAIL PROTECTED]>
Matías Software Group


Reply via email to