Re: Focus problems...

From: Harvey J. Stein <abel_at_netvision.net.il>
Date: Tue, 22 Oct 1996 20:29:23 +0200

Erick Gallesio writes:
> I have tested it with 3.1 and I had the same problem. It has gone in 3.1.1
> (I don't remember when I have corrected this, I should have a look at my
> log files, but there are in such a state that it is not so easy :<).

Thanks. Upgrading to 3.1.1 fixed the problems. However, I'm still
seeing one seemingly strange behavior. I started STk, version 3.1.1
:) and gave it the following commands:

   (require "Tk-classes")
   (define e1 (make <Entry> ))
   (define e2 (make <Entry> ))
   (define b (make <button>))
   (pack e1 b e2)

   (bind e1 "<Key-Tab>" (lambda () (focus e2)))
   (bind e2 "<Key-Tab>" (lambda () (focus e1)))
   (bind "all" "<Key-Tab>" "")

I would have expected that at this point, since I've wiped out the
"all" binding, that tabbing would go from e1 to e2 & visa versa. But,
it doesn't! It still hits the button in the middle.

However, if, after tabbing around a bit, I wipe out the "all" binding
again with:

   (bind "all" "<Key-Tab>" "")

Then, tabbing doesn't hit the button anymore!

Basically, it seems like giving the above command to wipe out the
"all" binding doesn't work until one of the widgets has been given
focus. In other words, the above sequence doesn't prevent the focus
from hitting the button, but the following does:

   (require "Tk-classes")
   (define e1 (make <Entry> ))
   (define e2 (make <Entry> ))
   (define b (make <button>))
   (pack e1 b e2)

   (bind e1 "<Key-Tab>" (lambda () (focus e2)))
   (bind e2 "<Key-Tab>" (lambda () (focus e1)))
   ;; We force the focus onto e1 before wiping out the "all" binding:
   (focus e1)
   (bind "all" "<Key-Tab>" "")

So, what's the explanation for this?

Thanks,

Dr. Harvey J. Stein
Berger Financial Research
abel_at_netvision.net.il
Received on Tue Oct 22 1996 - 21:15:43 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST