Re: [wxVTK] [ wxvtk-Bugs-1919659 ] keyboard events not caught
Brought to you by:
malat
From: Mathieu M. <mat...@gm...> - 2008-04-14 18:42:10
|
Please CC the wxVTK mailing list, as other might also have seen this issue. Just as a first step, did you try switching the wxGLCanvas to a regular wxWindow. You need to edit wxVTKRWI and remove the #define WX_USEGLCANVAS I have seen some flickering issue with wxGLCanvas, so... Anyone else seen this ? Thanks -Mathieu On Mon, Apr 14, 2008 at 5:58 PM, Juha-Ville Juntunen <jul...@gm...> wrote: > Thanks Mathieu, > > I'm using wxVTK on both linux and winXP and we might even port our app to OS > X at some point, so > I guess this makes me a suitable guinea pig for wxVTK testing ;) And I'm > happy to try out new versions of wxVTK in our environments when ever > available. > > Btw. I found another small weirdness in GTK version and this one does not > happen on windows: > > Apparently screen refreshing does not go right in GTK version because simply > calling wxWindows::Refresh() on the wxVTKRenderWindowInteractor leaves the > GL canvas blank. > Or it looks more like the GL content is first drawn and then the wxWidgets > container paints it over with the background color. > > This behaviour can be also seen with the wxSample app: when started the > screen is blank until user clicks the screen with mouse. Also, if user > switches between windows (e.g. alt-TAB) so that wxSample gets hidden and > then exposed/activated again the window is blank. Some times the content > (the cone) flashes in just for fraction of second before its painted over, > and this makes me believe it's overdrawn by the background colour by > wxWidgets. > > I got this problem fixed by explicitly throwing wxPaintEvent to > wxVTKrenderWindowInteractor when ever I need to refresh the VTK image. This > behgaviour can be seen in the Sample.cpp this by adding handler for > wxFocusEvent with following implementation: > > void MyFrame::OnFocus(wxFocusEvent&event) > { > wxPaintEvent e; > m_pVTKWindow->GetEventHandler()->AddPendingEvent(e); > > // if above line is commented and following uncommented > // screen refreshing does not work anymore > //m_pVTKWindow->Refresh(); > } > > I.e. with above implementation wxVTK screen gets correctly drawn when ever > mouse is moved over it. And if the Refresh() is used instead of > AddPendindgEvent() above, the wxVTK gets erased when ever mouse is moved > out and back over the wxVTK window. > > Not sure, however, if this one is bug or just a feature ? > > cheers > -j > > > > > 2008/4/14, Mathieu Malaterre <mat...@gm...>: > > > Hello, > > > > On Mon, Apr 14, 2008 at 4:25 PM, Juha-Ville Juntunen > > <jul...@gm...> wrote: > > > Hi Mathieu, > > > > > > Tried HEAD version on Gentoo with wxSample and the problem is still > there. > > > > > > Btw. I noticed > > > > > > this->SetFocus() > > > > > > added into OnButtonDown(event) method, but it's #ifdefine'd only for Mac > OSX > > > and Windows. If I take those #ifdefines out, behaviour changes a bit:I > still > > > don't get keyboard events caught by wxVTK when I enter the wxSample > window, > > > but after I click the window keyevents are caught. Is there reason > > > SetFocus() is not meant to be invoked on linux ? > > > > Simply because you are the first person to have this issue :) > > Well it looks like the patch was not tested under linux, or at least > > not under your specific configuration. I am pretty sure this is again > > a GTK 1.X vs GTK 2.x problem. I'll add the SetFocus for everybody, and > > hope that someone complains back if I broke anything :) > > > > Thanks again for your time, your feedback is extremely important, as I > > cannot test all possible configurations. > > -- > > > > Mathieu > > > > -- Mathieu |