Re: Pinning a Window to a Window
Re: Pinning a Window to a Window
- Subject: Re: Pinning a Window to a Window
- From: Uli Kusterer <email@hidden>
- Date: Sat, 23 Apr 2016 19:08:55 +0200
On 23 Apr 2016, at 14:27, Dave <email@hidden> wrote:
>> On 22 Apr 2016, at 18:17, Uli Kusterer <email@hidden> wrote:
>> - Whether you want in the app store. If not,
> Not, don’t want the App in the App store and the I’m not the developer of the other app.
>
> I just want to put a window in front of another a window in a given application and have it track that Window. A bit like if you have a sheet displayed on a Window, if you move the main window the sheet moves with it, if you click in the window of another App, and that App’s Window overlaps the the Window with the Sheet up, then it will appear on top of both the Main window and the Sheet.
>
> Because my window is a “Floating Window” it floats above the Windows of ALL applications, I want it to just float above the window in the App it is pinned to.
Is it really like a sheet, or is it more like xScope, where you annotate parts of that other window? The approach Bill Cheeseman suggests could work for the latter case, though I would say that, for performance reasons, you probably want to make your window smaller and move it around instead of redrawing every time.
>> you could theoretically inject your own code into another app and then add your own views or windows (but this has a lot of potential to break the other app, so isn't very popular and very hard to get right)
>
> I’m all ears and would love to know more about this?
I haven't done this in ages, but the basic approach is that you find some kind of plugin that gets loaded into the other application and are thus able to run in that process (Input Managers, AppleScript Scripting Additions, or the like ... search terms are SIMBL, Haxies or Osax, usually. Xcode and Mail also have plugin mechanisms, as do Photoshop and a few other big names), and then you can just make your window a subwindow of the existing one. Or you find some code that lets you inject code into another application, like Wolf Rentzsch's mach_inject.
But really, if you can at all avoid doing this, I'd recommend you find another way. We've had support nightmares caused by other developers who injected themselves into our applications and made assumptions that didn't hold, and it took us ages to realize where the code was coming from that was causing unexpected behaviour in *our* application. You'll have to program very defensively.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://stacksmith.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden