Re: NSWindow in threads
Re: NSWindow in threads
- Subject: Re: NSWindow in threads
- From: Mike Abdullah <email@hidden>
- Date: Tue, 26 May 2009 15:27:14 +0100
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@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
_______________________________________________
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