Re: Listbox key bindings not working as expected

"Rainer J.H. Brandt" <[email protected]> Fri, 13 Aug 2010 11:31:16 +0200
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
Hi,

thanks for your quick answer.
You wrote:
> key bindings will work only when keyboard focus is on the widget. Try set=
ting focus like this
> =

>  use Tk;
>  $mw =3D MainWindow->new();
>  $lb =3D $mw->Listbox()->pack();
>  $lb->insert('end', 1..5);
> =

>  $lb->focus();
> =

>  MainLoop;

Thanks, your suggestion works.
However, I'm astonished.  Clicking on the widget with the mouse
doesn't give it keyboard focus?  I've never seen a GUI that behaved
like that.  Well, I must have seen it, but haven't noticed it in 14
years of programming and using Perl/Tk on a daily basis...

Greetings,
Rainer
-- =

Rainer J. H. Brandt
Brandt & Brandt Computer GmbH
Am Wiesenpfad 6, 53340 Meckenheim
Gesch=E4ftsf=FChrer: Rainer J. H. Brandt und Volker A. Brandt
Handelsregister: Amtsgericht Bonn, HRB 10513

RFC 5322: "Each line [...] SHOULD be no more than 78 characters"
--++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--+=
+**=3D=3D
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk