Re: Win32Lib Losing Keys
- Posted by Derek Parnell <ddparnell at bigpond.com> Jul 08, 2004
- 456 views
Pete Lomax wrote: > > On Thu, 08 Jul 2004 08:41:07 -0700, cklester <guest at RapidEuphoria.com> > wrote: > > >> setEnable(PushButton4,False) > >> setFocus(Window1) > >> setEnable(PushButton4,True) > > > >I don't understand why setFocus(Window1) doesn't do the job > >sufficiently here. However, your suggestion does work for me! > Me neither. Maybe Derek can comment? When we talk about 'focus' we are talking about *keyboard* focus. That is, which element in the display recieves keyboard events. In the Windows paradigm, the only elements that normally get focus are those that keyboard activity makes sense for. Now, true, this is a bit arbitary but Microsoft, and other GUI designs, have decided that in doesn't make sense for the parent (background) window to react to keystrokes. So in a nutshell, windows don't get focus but (most other) controls do. In Win32lib, when a window gets a 'GotFocus' message, I try to locate the child control that last had focus for that window and set the new focus to that control, rather than the Window itself (and thus no control in that window). This is especially relevant when moving between windows. So I put it to the user base of this library: What do you want to happen when a Window gets a 'GotFocus' message? -- Derek Parnell Melbourne, Australia