can't get EVT_KEY_DOWN, but just on Windows

I know something about event propagation, and since EVT_KEY_DOWN is a
non-propagating event I successfully got it (when focus is on the
panel of the secondary frame) by the line:

self.MainFrame.SecondaryFrame.secondaryFramePanel.Bind(wx.EVT_KEY_DOWN,
self.KeyDownAction)

Unfortunately it doesn't seems to work on windows (XP and 7). Any
suggestions?

Excuse me, I forgot to clarify:
-the code works perfectly on linux
-I get no error, simply the event seems not caught
-my app has a parent frame (MainFrame) and a children (SecondaryFrame)
with a panel (secondaryFramePanel)

I hope you don't need a sample app..

···

On 10 Mar, 09:45, andreaconsole <andreacons...@gmail.com> wrote:

I know something about event propagation, and since EVT_KEY_DOWN is a
non-propagating event I successfully got it (when focus is on the
panel of the secondary frame) by the line:

self.MainFrame.SecondaryFrame.secondaryFramePanel.Bind(wx.EVT_KEY_DOWN,
self.KeyDownAction)

Unfortunately it doesn't seems to work on windows (XP and 7). Any
suggestions?

Moreover, I think that is important, I have two buttons on the panel
and I avoid them to get focus with the line:

self.MainFrame.SecondaryFrame.secondaryPanel.SetFocusIgnoringChildren()

···

On 10 Mar, 11:22, andreaconsole <andreacons...@gmail.com> wrote:

On 10 Mar, 09:45, andreaconsole <andreacons...@gmail.com> wrote:

> I know something about event propagation, and since EVT_KEY_DOWN is a
> non-propagating event I successfully got it (when focus is on the
> panel of the secondary frame) by the line:

> self.MainFrame.SecondaryFrame.secondaryFramePanel.Bind(wx.EVT_KEY_DOWN,
> self.KeyDownAction)

> Unfortunately it doesn't seems to work on windows (XP and 7). Any
> suggestions?

Excuse me, I forgot to clarify:
-the code works perfectly on linux
-I get no error, simply the event seems not caught
-my app has a parent frame (MainFrame) and a children (SecondaryFrame)
with a panel (secondaryFramePanel)

I hope you don't need a sample app..

ok, I found: it seems that SetFocusIgnoringChildren() doesn't work
with panels under Windows

···

On 10 Mar, 12:13, andreaconsole <andreacons...@gmail.com> wrote:

On 10 Mar, 11:22, andreaconsole <andreacons...@gmail.com> wrote:

> On 10 Mar, 09:45, andreaconsole <andreacons...@gmail.com> wrote:

> > I know something about event propagation, and since EVT_KEY_DOWN is a
> > non-propagating event I successfully got it (when focus is on the
> > panel of the secondary frame) by the line:

> > self.MainFrame.SecondaryFrame.secondaryFramePanel.Bind(wx.EVT_KEY_DOWN,
> > self.KeyDownAction)

> > Unfortunately it doesn't seems to work on windows (XP and 7). Any
> > suggestions?

> Excuse me, I forgot to clarify:
> -the code works perfectly on linux
> -I get no error, simply the event seems not caught
> -my app has a parent frame (MainFrame) and a children (SecondaryFrame)
> with a panel (secondaryFramePanel)

> I hope you don't need a sample app..

Moreover, I think that is important, I have two buttons on the panel
and I avoid them to get focus with the line:

self.MainFrame.SecondaryFrame.secondaryPanel.SetFocusIgnoringChildren()

Hmmm... It looks like SetFocusIgnoringChildren always delegates to the base class' SetFocus. Maybe I'm being a little blind today but I don't see where it is overridden to do anything else... Perhaps it wasn't ever finished? :frowning:

···

On 3/10/11 3:32 AM, andreaconsole wrote:

On 10 Mar, 12:13, andreaconsole<andreacons...@gmail.com> wrote:

On 10 Mar, 11:22, andreaconsole<andreacons...@gmail.com> wrote:

On 10 Mar, 09:45, andreaconsole<andreacons...@gmail.com> wrote:

I know something about event propagation, and since EVT_KEY_DOWN is a
non-propagating event I successfully got it (when focus is on the
panel of the secondary frame) by the line:

self.MainFrame.SecondaryFrame.secondaryFramePanel.Bind(wx.EVT_KEY_DOWN,
self.KeyDownAction)

Unfortunately it doesn't seems to work on windows (XP and 7). Any
suggestions?

Excuse me, I forgot to clarify:
-the code works perfectly on linux
-I get no error, simply the event seems not caught
-my app has a parent frame (MainFrame) and a children (SecondaryFrame)
with a panel (secondaryFramePanel)

I hope you don't need a sample app..

Moreover, I think that is important, I have two buttons on the panel
and I avoid them to get focus with the line:

self.MainFrame.SecondaryFrame.secondaryPanel.SetFocusIgnoringChildren()

ok, I found: it seems that SetFocusIgnoringChildren() doesn't work
with panels under Windows

--
Robin Dunn
Software Craftsman

Excuse me, I cannot understand what you mean, indeed... :blush:

···

On 10 Mar, 20:00, Robin Dunn <ro...@alldunn.com> wrote:

On 3/10/11 3:32 AM, andreaconsole wrote:

> On 10 Mar, 12:13, andreaconsole<andreacons...@gmail.com> wrote:
>> On 10 Mar, 11:22, andreaconsole<andreacons...@gmail.com> wrote:

>>> On 10 Mar, 09:45, andreaconsole<andreacons...@gmail.com> wrote:

>>>> I know something about event propagation, and since EVT_KEY_DOWN is a
>>>> non-propagating event I successfully got it (when focus is on the
>>>> panel of the secondary frame) by the line:

>>>> self.MainFrame.SecondaryFrame.secondaryFramePanel.Bind(wx.EVT_KEY_DOWN,
>>>> self.KeyDownAction)

>>>> Unfortunately it doesn't seems to work on windows (XP and 7). Any
>>>> suggestions?

>>> Excuse me, I forgot to clarify:
>>> -the code works perfectly on linux
>>> -I get no error, simply the event seems not caught
>>> -my app has a parent frame (MainFrame) and a children (SecondaryFrame)
>>> with a panel (secondaryFramePanel)

>>> I hope you don't need a sample app..

>> Moreover, I think that is important, I have two buttons on the panel
>> and I avoid them to get focus with the line:

>> self.MainFrame.SecondaryFrame.secondaryPanel.SetFocusIgnoringChildren()

> ok, I found: it seems that SetFocusIgnoringChildren() doesn't work
> with panels under Windows

Hmmm... It looks like SetFocusIgnoringChildren always delegates to the
base class' SetFocus. Maybe I'm being a little blind today but I don't
see where it is overridden to do anything else... Perhaps it wasn't
ever finished? :frowning:

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

SetFocusIgnoringChildren is implemented in a macro used for blending control container functionality into other window classes, like this:

     void classname::SetFocusIgnoringChildren()
     {
         basename::SetFocus();
     }

And I said that I couldn't find anywhere that this is overridden in a derived class to actually do anything that explicitly ignores children. So basically, unless I'm just not seeing something, it appears that SetFocusIgnoringChildren is currently the same as SetFocus.

···

On 3/10/11 2:36 PM, andreaconsole wrote:

On 10 Mar, 20:00, Robin Dunn<ro...@alldunn.com> wrote:

On 3/10/11 3:32 AM, andreaconsole wrote:

ok, I found: it seems that SetFocusIgnoringChildren() doesn't work
with panels under Windows

Hmmm... It looks like SetFocusIgnoringChildren always delegates to the
base class' SetFocus. Maybe I'm being a little blind today but I don't
see where it is overridden to do anything else... Perhaps it wasn't
ever finished? :frowning:

Excuse me, I cannot understand what you mean, indeed... :blush:

--
Robin Dunn
Software Craftsman