NSColorPanel, PickColor and Carbon
NSColorPanel, PickColor and Carbon
- Subject: NSColorPanel, PickColor and Carbon
- From: Alan Shouls <email@hidden>
- Date: Mon, 19 Sep 2005 10:37:25 +0100
Hi,
We are using the NSColorPanel as a floating palette in a carbon
application and are having problems with it once we use any of the
calls NPickColor, PickColor or GetColor. After making one of these
calls the floating colour palette becomes forever modal. I will
explain the situation in more detail.
Our application, is a carbon application and we have added support
for the NSColorPanel within it. We have added some call-backs and a
few other very minor things and it works very well. The user
experience is good.
Elsewhere in the application we have some modal dialogs that require
the user to choose colours. In these situations we use the PickColor
calls. At this point the following happens
- colour palette disappears (fine) and is replaced by a modal dialog (fine)
- the user chooses a colour (fine)
- and the modal colour dialog disappears (fine)
- the colour palette reappears (fine)
- we dismiss our modal dialog (fine)
As long as the colour palette is visible the application is in a
modal state - we can no longer click on any window behind the colour
palette within the application beeping.
I have looked at ways of fixing this but am stuck. I think the
problem is that after taking the colour panel and starting a modal
session somehow the window is marked as being modal. The reason I
believe this is that I get the same results if I call
NSColorPanel *panel = [NSColorPanel sharedColorPanel];
[NSApp runModalForWindow:panel];
or if I call
NSModalSession session1 = [NSApp beginModalSessionForWindow:panel];
for (;;) {
if ([NSApp runModalSession:session1] != NSRunContinuesResponse)
break;
}
[NSApp endModalSession:session1];
(I make sure that there is code to call '[NSApp stopModalWithCode:1]' etc.)
So really at the moment I am stuck.
- It is not possible (as far as I can see) to have the cocoa palette
working within our carbon modal session.
- Starting of a modal session on the NSColorPanel sharedColorPanel
forever nobbles it into a modal twilight state (within carbon),
whether this is through PickColour (and friends) or making our own
modal session.
- It is not possible to make a copy (as far as I can see) of the colour panel.
Can anyone to tell me how I can get the color panel to behave
normally within carbon after a modal session.
Best regards
Alan Shouls
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden