NSWindow in threads
NSWindow in threads
- Subject: NSWindow in threads
- From: Mattias Jansson <email@hidden>
- Date: Tue, 26 May 2009 11:51:32 +0200 (CEST)
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@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