Dear list,

I built a GUI using tkinter and tix (python 3.1/linux)
and have a frame which wants to receive key events
in a certain "mode". I do this when initializing the frame:

class WBuildMenu(Frame, View):
...
    self._keyID = self.bind('<Key>', self._onKey, add=True)


and later when entering the "mode":

...
    self.focus_set()
    self._FocusID = self.bind('<FocusOut>' , self._focusLost, add=True)

I then receive key events correctly.
I expected to get <FocusOut> event when my frame loses
focus and no longer receives key events.
Am I correct in expecting this behaviour?
(I wanted to repeat "self.focus_set()" in this case)

What I really get is this: I only get FocusOut when the mouse
leaves the application window. I do not get FocusOut event
when I click some other part of the application window
which nonetheless results in the frame losing focus and no longer
receiving key events.
Currently, my guess is that this is broken in tix
(which unluckily seems not to be under development any more).

Any other opinions?
Any other method to track focus which I missed?

Thanks for any hints,
Matthias Kievernagel
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to