TextPresenter setFocus...

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

TextPresenter setFocus...

talios@gmail.com
Something simple I'm sure,

I just added the following to my shell:

    SMSComposerShell>>onViewOpened
        "Set focus and do other view-initialization things."
        super onViewOpened.
        contentPresenter setFocus

...with the intention that when the view was shown, focus would be given
to the contentPresenter, which is a multiline TextPresenter, but focus
remains were it was.

Something simple I'm sure...?


Reply | Threaded
Open this post in threaded view
|

Re: TextPresenter setFocus...

Yar Hwee Boon-3
On Thu, 30 Sep 2004 15:07:19 +1200, Mark Derricutt <[hidden email]>  
wrote:

> Something simple I'm sure,
>
> I just added the following to my shell:
>
>     SMSComposerShell>>onViewOpened
>         "Set focus and do other view-initialization things."
>         super onViewOpened.
>         contentPresenter setFocus
>
> ...with the intention that when the view was shown, focus would be given  
> to the contentPresenter, which is a multiline TextPresenter, but focus  
> remains were it was.
>
> Something simple I'm sure...?

Does this help:  
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&safe=off&threadm=8vgabj%24hfd%241%40taliesin.netcom.net.uk&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26safe%3Doff%26c2coff%3D1%26q%3Dsetfocus%2Bian%26btnG%3DSearch%26meta%3Dgroup%253Dcomp.lang.smalltalk.dolphin 
(browse #postToInputQueue)?

A simpler approach might be to just set the control to the top of the  
z-order?

--
Regards
HweeBoon
MotionObj


Reply | Threaded
Open this post in threaded view
|

Re: TextPresenter setFocus...

Blair McGlashan-3
In reply to this post by talios@gmail.com
"Mark Derricutt" <[hidden email]> wrote in message
news:cjft95$[hidden email]...

> Something simple I'm sure,
>
> I just added the following to my shell:
>
>    SMSComposerShell>>onViewOpened
>        "Set focus and do other view-initialization things."
>        super onViewOpened.
>        contentPresenter setFocus
>
> ...with the intention that when the view was shown, focus would be given
> to the contentPresenter, which is a multiline TextPresenter, but focus
> remains were it was.
>
> Something simple I'm sure...?

The framework sets the initial focus when the view is first "activated",
which happens later. The default implementation is to set focus to the first
control in the tab order (which equates to the first enabled view with a tab
stop in the z-order). If you want different behaviour override
#setInitialFocus in your Shell (presenter) subclass.

Regards

Blair