From: Gordon Hartley Date: 2003-01-28T10:39:31+09:00 Subject: Re: FXTexr and widget focus On Mon, 27 Jan 2003 18:13:15 -0600, Lyle Johnson wrote: >The most straightforward solution is to intercept the SEL_KEYPRESS >message that the FXText widget sends to its message target, and then >handle the tab key yourself. Here's the code: > > myText.connect(SEL_KEYPRESS) { |sender, sel, event| > if event.code == KEY_Tab > if (event.state & SHIFTMASK) != 0 > getApp().focusWindow.handle(self, > MKUINT(0, SEL_FOCUS_PREV), event) > else > getApp().focusWindow.handle(self, > MKUINT(0, SEL_FOCUS_NEXT), event) > end > else > 0 # keypress was not handled here > end > } > Hi Lyle, Thanks for the help above, it does seem to work by itself, but I can't seem to integrate it with frames (I have 4 vertical frames sitting in a horizontal one). It always the _NEXT always ends up on focusing at the first control in the frame, and previous takes it to the last control in the last frame. I've played around with it quite a bit, but haven't been successful so far... I'm sure it should be obvious, but obviously not to me. Any more great words of FXWisdom? Thanks, Gordon