You've missed the big warning somewhere in the docs that most of AppKit is not threadsafe. Why do you want to create a window on another thread? What is wrong with doing it on the main thread?

On 26 May 2009, at 10:51, Mattias Jansson wrote:


I'm trying to create a window from code in a thread created with NSThread detachNewThreadSelector:toTarget:withObject

The main thread simply calls NSApplicationMain

The window is created with
[[NSWindow alloc] initWithContentRect:rect styleMask: (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask| NSResizableWindowMask) backing:NSBackingStoreRetained defer:YES]

The window has an empty view set with
setContentView:[[NSView alloc] initWithFrame:[window contentRectForFrameRect:[window frame]]

However, the titlebar is not redrawn correctly, and the standard buttons (zoom, close) does not redraw their active states when mouse moves over them but remain greyed out. They do respond to click events though.

I've been reading the API docs but I can't figure out what I've missed in order to get the window drawing the title bar correctly. Any ideas?

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to