[squeak-dev] Morphic focus

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Morphic focus

Mark Volkmann
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







smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Morphic focus

Gary Chambers-4
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" <[hidden email]>
To: "The general-purpose Squeak developers list"
<[hidden email]>
Sent: Tuesday, October 28, 2008 12:43 PM
Subject: [squeak-dev] Morphic focus


>
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Morphic focus

Mark Volkmann
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" <[hidden email]>
> To: "The general-purpose Squeak developers list" <[hidden email]
> >
> 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







smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Morphic focus

Gary Chambers-4
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" <[hidden email]>
To: "The general-purpose Squeak developers list"
<[hidden email]>
Sent: Tuesday, October 28, 2008 3:36 PM
Subject: Re: [squeak-dev] Morphic focus


>
>