[Q on MVC] How can I make my MVC app to save/accept on enter/return key input?

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

[Q on MVC] How can I make my MVC app to save/accept on enter/return key input?

Sungjin Chun
Hi,

I've developed an app which receives text input using
PluggableTextView. The problem is that
users should input cmd-s to save his/her editing. They want to use
enter/return to save the text
input. How can I do this?

Thank you in advance.

PS)
I know everybody uses morphic, but if there's someone who can help me... :-)

Reply | Threaded
Open this post in threaded view
|

Re: [Q on MVC] How can I make my MVC app to save/accept on enter/return key input?

David T. Lewis
On Thu, Sep 02, 2010 at 02:41:44PM +0900, Sungjin Chun wrote:

> Hi,
>
> I've developed an app which receives text input using
> PluggableTextView. The problem is that
> users should input cmd-s to save his/her editing. They want to use
> enter/return to save the text
> input. How can I do this?
>
> Thank you in advance.
>
> PS)
> I know everybody uses morphic, but if there's someone who can help me... :-)
Hi,

I did this for the MVC user interface in CommandShell. I made subclasses
of PluggableTextView and PluggableTextController, and implemented
PluggableTextController>>dispatchOnCharacter:with: to cause enter/return
to accept the input. It's not elegant but it works.

I have attached a copy of these two classes, and you can find
the complete CommandShell package on SqueakSource or at
http://wiki.squeak.org/squeak/1914

HTH,

Dave