• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using PBXSourceFileEditor in an XCode plug-in
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using PBXSourceFileEditor in an XCode plug-in


  • Subject: Re: Using PBXSourceFileEditor in an XCode plug-in
  • From: Joe Osborn <email@hidden>
  • Date: Sun, 14 Dec 2003 18:06:05 -0600

Hello, everyone.
...

2. It is rather dumb(it doesn't propagate the necessary notifications, etc to the PBXProjectIndex that it should rebuild its index of an edited file).
3. It does not use the 'normal' PBXSourceFileEditor text view, which means no breakpoints, no syntax coloring, no line numbers, no indenting, no completion, no search, no nothing.
Fixed it.  Here's the code:

    editor = [[NSClassFromString(@"PBXSourceFileEditor") alloc] init];

....

[editor replaceFileDocument:[NSClassFromString(@"PBXSourceFileDocument") fileDocumentForFileReference:[[[NSClassFromString(@"PBXFileReference") alloc] initWithPath:[symbol sourceFile]] autorelease] loadIfNeeded:YES]];
[[editor view] setFrame:[scrollView frame]];
[splitView replaceSubview:scrollView with:[editor view]];
scrollView = [editor view];
textView = [scrollView documentView];


And that's it. splitView, scrollView, and textView are all IBOutlets. I thought I had done it this way before, but I guess not. Regardless, it worked this time, albeit with one caveat: key commands(cmd-s, cmd-b, what-have-you) are (presumably )not being sent up the 'real' XCode responder chain. Any command will result in an NSBeep(). This is unfortunate. I tried [self setNextResponder:editor] and [[self window] setNextResponder:editor], but to no avail. Any ideas on that?

Any ideas? I tried to poke around using F-Script Anywhere, but it just crashed... I've been scraping by with class-dump, but I'm stuck now. Anyone have an idea?
(I decided that it would be acceptable to put a way to get to an F-Script interpreter into my plug-in. It worked beautifully.)

(One more thing, an easy AppleScript question: How do I put the 'plug-ins' menu to the left of the 'window' menu in the menu bar[and then only if it's not already there]? Thanks in advance.)
Still haven't gotten to this...


(still)
__joe
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Using PBXSourceFileEditor in an XCode plug-in (From: Joe Osborn <email@hidden>)

  • Prev by Date: Using PBXSourceFileEditor in an XCode plug-in
  • Next by Date: Get Info and Additional Compiler Flags bug
  • Previous by thread: Using PBXSourceFileEditor in an XCode plug-in
  • Next by thread: Get Info and Additional Compiler Flags bug
  • Index(es):
    • Date
    • Thread