• 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: Initializing NSWindow with Carbon window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initializing NSWindow with Carbon window


  • Subject: Re: Initializing NSWindow with Carbon window
  • From: Graham Cox <email@hidden>
  • Date: Mon, 31 Jan 2011 15:18:23 +1100

On 31/01/2011, at 3:02 PM, Andrew James wrote:

> For once I actually should have "cut-and-paste":
>
> NSWindow *wrapper = [ [ NSWindow alloc ] initWithWindowRef:
> carbonBuilder.GetProduct() ];
> [ wrapper makeKeyAndOrderFront: self];
>
> I did have the sender being sent correctly.  Window still does not show with
> this approach. Nice catch though.
>
> I'm going to keep trying. Going to see if makeKeyAndOrderFront is causing any
> Carbon Events to be generated for the wrapped window.
>
> I may also take the route of subclassing NSWindowController with something like
> WrappedCarbonWindowController and look into subclassing methods like showWindow.
> Implementing a window delegate my also help.  I've got options that I'm going
> to explore.


There are some simpler things to try first.

Does carbonBuilder.GetProduct() actually return anything?

Is the <wrapper> variable set to something after creating the window?

If yes to both, try looking at properties of <wrapper>, such as its frame. That will tell you if it's actually supposed to be on the screen.

If the window object isn't created, it might be that the carbon window type and/or combination of flags isn't supported, so you may have to go back and modify the carbon window you return to something currently legal. (I'm guessing here, I haven't had cause to do this myself, but AFAIK -initWithWindowRef: is not broken).

Adding a window delegate isn't required to show a window, and adding one is only going to complicate matters at this stage. Also, I don't know that carbon events are generated even if NSWindow was inited with a carbon window.

--Graham


_______________________________________________

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

  • Follow-Ups:
    • Re: Initializing NSWindow with Carbon window
      • From: Andrew James <email@hidden>
References: 
 >Re: readInBackgroundAndNotify and rsync output (From: Greg Guerin <email@hidden>)
 >Initializing NSWindow with Carbon window (From: Andrew James <email@hidden>)
 >Re: Initializing NSWindow with Carbon window (From: Graham Cox <email@hidden>)
 >Re: Initializing NSWindow with Carbon window (From: Andrew James <email@hidden>)

  • Prev by Date: Re: Add a view (xib) to a project
  • Next by Date: NSTableView selecting text within a cell
  • Previous by thread: Re: Initializing NSWindow with Carbon window
  • Next by thread: Re: Initializing NSWindow with Carbon window
  • Index(es):
    • Date
    • Thread