[wxGTK 2.6.3] Propagating key events?

Vadim Zeitlin vadim at wxwindows.org
Sat Sep 16 04:43:56 PDT 2006


On Fri, 15 Sep 2006 21:30:53 -0400 Spencer Salazar <spencer.salazar at gmail.com> wrote:

SS> So far, Ive tried intercepting key events in the child frames and  
SS> forwarding them to the parent window, to no avail.  Heres my code:
SS> 
SS> void myChildFrame::OnChar( wxKeyEvent & event )
SS> {
SS>      GetParent()->ProcessEvent( event );
SS> }
...
SS> Is there a good way to do this?

 No, this isn't going to work.

SS> I dont want to actually have a menu  bar in the child frames for
SS> esthetic reasons, and I want to avoid  building separate
SS> wxAcceleratorTables to match the parent frame menu  bar, because that
SS> doesnt seem very maintainable.

 This is the only way I see to make it work though. Also, if you have some
function creating/adding accelerators to the table I don't see why should
it be unmaintainable.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list