Compositing/Non Compositing/HiCocoaView

External developers... This forum's for you!

Compositing/Non Compositing/HiCocoaView

Postby sctell » Thu Jul 28, 2011 2:37 pm

Hi,

I have touched on HiCocoaView before and been advised that SC's windows are none compositing therefore HiCocoaView is a no go area.

A thought occurred for which I do not know the answer therefore I am looking for a little guidance.

Is it possible to mix compositing and none compositing carbon windows?

If yes would it be possible to group the two windows? One acting as an overlay.

If yes could one use a HiCocoaView in the compositing window which has been grouped with the none compositing window?

What are the pitfalls?

I have semi succeeded with some externals with Cocoa overlay windows but the grouping is troublesome. I thought it may be better with this solution?

All the best

Terry
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am

Re: Compositing/Non Compositing/HiCocoaView

Postby witness » Sat Jul 30, 2011 3:09 am

sctell wrote:Is it possible to mix compositing and none compositing carbon windows?


Sure. We've had lots of applications that did that. Of course, there's always the chance of something in SuperCard assuming non-compositing windows, but it'll likely just work.

sctell wrote:If yes would it be possible to group the two windows? One acting as an overlay.


I haven't tried that yet, but I'd expect it to work until proven otherwise.

sctell wrote:If yes could one use a HiCocoaView in the compositing window which has been grouped with the none compositing window?


Again, I haven't tried that yet. But Window Groups are quite temperamental, and since HICocoaView AFAIK attaches a borderless Cocoa window to the Carbon window it is in, which hosts the NSViews, you may get nested window groups, which is something that isn't very reliable. Occasionally, the child windows just separate again, (e.g. when bringing up a sheet), or you run into activation issues. So as much as I'd like to do this, I'm not sure it's a good idea to try.

sctell wrote:I have semi succeeded with some externals with Cocoa overlay windows but the grouping is troublesome. I thought it may be better with this solution?


I think it'd be worth trying it just for the heck of it (and in case it succeeds, it'd be very handy), but I wouldn't get my hopes up.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are Everywhere..."
http://www.zathras.de
User avatar
witness
 
Posts: 57
Joined: Thu Jul 17, 2008 2:24 pm

Re: Compositing/Non Compositing/HiCocoaView

Postby sctell » Sat Jul 30, 2011 4:05 am

Hi Uli,
Thanks for the advice.

witness wrote:But Window Groups are quite temperamental, and since HICocoaView AFAIK attaches a borderless Cocoa window to the Carbon window it is in, which hosts the NSViews, you may get nested window groups, which is something that isn't very reliable. Occasionally, the child windows just separate again, (e.g. when bringing up a sheet), or you run into activation issues. So as much as I'd like to do this, I'm not sure it's a good idea to try.


I didn't know that HiCocoaView attaches a borderless Cocoa window.
If this is correct then it just seems to add an additional layer of complexity because I have succeeded in getting a Cocoa overlay window attached to a SC window by using:

[myCocoaWindow windowRef]

then creating a Carbon group and adding this windowRef to the group.

It does work well, I just have to sort out things like

Collapse
Expand
Focus of SC fields when switching to the Cocoa window.

I currently have an NSTableView (trying to improve my previous external) which when it receives a mouseDown clears the focus from the SC card by sending SC message "click at -1,-1" and going the other way when an openField message is received in SC I.....

SetUserFocusWindow ([self parentWindowRef]);

It does seem to work quite well, I am going to look at Collapse/Expand nest.

Any tips?

All the best

Terry
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am


Return to Xcode and the Internals Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest

cron