How can I make focus start in a given text field? I thought sending wantsKeyboardFocus to a TextFieldMorph would do it, but that didn't work.
--- Mark Volkmann
With Polymorph loaded, send #takeKeyboardFocus to the morph. Without do ActiveHand newkeyboardFocus: yourMorph
The preference #mouseOverForKeyboardFocus should be off for this to stick, of course ;-)
Regards, Gary.
----- Original Message ----- From: "Mark Volkmann" mark@ociweb.com To: "The general-purpose Squeak developers list" squeak-dev@lists.squeakfoundation.org Sent: Tuesday, October 28, 2008 12:43 PM Subject: [squeak-dev] Morphic focus
On Oct 28, 2008, at 10:14 AM, Gary Chambers wrote:
With Polymorph loaded, send #takeKeyboardFocus to the morph. Without do ActiveHand newkeyboardFocus: yourMorph
Hmm ... I tried this and it didn't work. My code opens a window that displays two labels, two text fields and a button. When I click the title bar of the window, no morph inside it gets focus until I click a morph. I tried "ActiveHand newKeyboardFocus: myTextField" both before and after I open the window.
The preference #mouseOverForKeyboardFocus should be off for this to stick, of course ;-)
I don't have mouseClickForKeyboardFocus or mouseOverForKeyboardFocus enabled.
Regards, Gary.
----- Original Message ----- From: "Mark Volkmann" mark@ociweb.com To: "The general-purpose Squeak developers list" <squeak-dev@lists.squeakfoundation.org
Sent: Tuesday, October 28, 2008 12:43 PM Subject: [squeak-dev] Morphic focus
How can I make focus start in a given text field? I thought sending wantsKeyboardFocus to a TextFieldMorph would do it, but that didn't work.
--- Mark Volkmann
If using Polymorph with controls in a window then either you need to set the focus after the window is activated or, if subclassing DialogWindow, override either #defaultButton or #defaultFocusMorph.
Otherwise, try sending #rememberKeyboardFocus: with your morph prior to opening/activating the window.
Focus handling was virtually non-existent in Morphic. Polymorph tries to help while maintaining some backwards compatability. Sorry it is somewhat awkward!
Regards, Gary.
----- Original Message ----- From: "Mark Volkmann" mark@ociweb.com To: "The general-purpose Squeak developers list" squeak-dev@lists.squeakfoundation.org Sent: Tuesday, October 28, 2008 3:36 PM Subject: Re: [squeak-dev] Morphic focus
squeak-dev@lists.squeakfoundation.org