Focus vs. Activation

Vadim Zeitlin vadim at wxwidgets.org
Fri Aug 3 09:16:22 PDT 2007


On Fri, 03 Aug 2007 15:34:28 -0000 crjjrc <crjjrc at gmail.com> wrote:

c> Thanks.  Your explanation helped me figure out a problem where I did
c> need to set focus.  We had a wxMiniFrame composing a periodic table of
c> the elements.  The user could "click" a button by typing the atomic
c> symbol or by clicking on it with the mouse.  The first method,
c> however, failed to work under GTK wx2.8 unless a button had been mouse-
c> clicked on first.  On Windows and OS X, keyboard clicking worked
c> immediately, without requiring a mouse click first.  We were able to
c> fix this under GTK by setting focus on one of the buttons.  Doesn't
c> make much sense to me, but it works.

 Why doesn't it make sense? For the window to receive the click it must
have focus.

c> I had tried explicitly giving the wxMiniFrame focus with SetFocus(),
c> but the focus event handlers were never called.  So, focus doesn't
c> happen for wxFrames, but just wxWindows?

 wxFrame shouldn't get focus (under any platform) if it has child controls.

 Regards,
VZ

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





More information about the wx-users mailing list