Re: controlTextDidChange, backspace possible?
Re: controlTextDidChange, backspace possible?
- Subject: Re: controlTextDidChange, backspace possible?
- From: Harilaos Skiadas <email@hidden>
- Date: Tue, 14 Sep 2004 10:40:35 -0700 (PDT)
--- j o a r <email@hidden> wrote:
> Do do that I think that you need to subclass, and I
> guess that you can
> choose between subclassing the text field or it's
> field editor.
>
> In both cases you can use something like the
> technique that I outlined
> in the recent thread "class needs access to table
> data source".
>
Thanks, I'll check that out.
> To say anything about your drag and drop problem I
> would need to know
> more about what you're doing.
>
Basically this window is kind of a console window, in
the sense that it runs an interactive unix program
through an NSTask, and sends it commands and spits the
output in a text view that it has. My text field is
used to type in those commands, and send them upon
pressing enter.
What I want to do is the following: I have another
window with a text view, on which the user can write a
little program, with one command on each line. Then I
want him to be able to drag a selection of some of
those lines and drop them in the console window, when
the string would be broken up into an array of strings
with componentsSeparatedByString:@"\n" to pick out
each string, and then they would be put in a queue and
then sent one after the other for execution.
My problem I think was in my bad design, where I had
the subclass of the text field call the method to send
the command across, and then for handling this whole
list of commands, I had my program type each one of
them in the text field and then call the text field's
sendCommand method, which I am starting to realize was
probably a terrible mistake. The problem arose in the
following situation: When my text field had focus and
I moved to the other window to start the drag, it
seems that the field editor remained attached to the
field, and hence when I tried to drag and drop, the
field editor would try to handle it and my subclass's
performDragOperation would never be called (even
though my subclass's draggingEntered and
draggingExited where).
I posted this a couple days ago under "Text Views,
Text Fields and dragging", but I didn't get any
responses.
I feel this behavior is a bit buggy. Shouldn't the
field editor detach itself from the text field when
the window loses key status, not only when the field
loses focus?
I am very new at designing applications I guess (heck,
this is my first application that has reached running
status). Any suggestions about how I should structure
this would be much appreciated.
Sorry if the above was too long.
> j o a r
>
Haris
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden