Tuesday, 15 May 2012

objective c - Modify multiple NSTextView with commands -



objective c - Modify multiple NSTextView with commands -

i'm wondering if knows if possible modify multiple nstextviews menu bar command. illustration if user selects "bold" menu bar, different nstextviews selected update content show bold.

here set have:

@interface mycustomtextfield : nsview <nstextviewdelegate>{ nstextview *textview; bool selected; ... }

so have own custom class , within each custom class have nstextview, var determining whether or not view selected , other stuff.

i'm able select multiple fields i've read on apple documentation every nstextview in window shares 1 field editor. when user edits nstextview sending commands field editor processes , routes nstextview. if case mean need create own custom field editor , route commands custom selected text classes instead?

==edit== customtextfield classes have variable named "selected" (see above) , holding shift or apple key downwards i'm able "select" multiple customtextfield instances (i set mask in front end of nstextview instances catches mousedown message).

so selection, multiple instances have "selected" attribute set true. far first responder window, set mask shows bluish halo around nstextviews.

i'm wondering if can tell app take default nstextview commands (such bold, italicize, etc.) , if supply custom field editor, pass appropriate messages selected customtextfields pass on nstextviews.

in head message passed this:

user submits text toolbar command > custom field editor > mycustomtextfield > nstextview

hopefully explanation made sense or maybe i'm in lala land now.

objective-c cocoa nstextview

No comments:

Post a Comment