Skip navigation.
 
mlRe: Newbie Question: Controls not redrawing on changes
FROM : Mike Abdullah
DATE : Sun May 04 12:07:07 2008

Are you sure you're running the event loop correctly? It sounds to me 
that Cocoa is not getting a chance to do its usual behaviour of 
calling -displayIfNeeded at the end of the event loop. What if you 
manually call that method yourself?

Mike.

On 4 May 2008, at 10:19, Christopher Kempke wrote:

> Yes, it appears that I want an NSPanel instead of an NSWindow for my 
> modal dialogs, but I think the modality is a red herring here: I 
> just tried adding the same checkbox and button controls to a 
> floating window and a document window:  they don't visibly update 
> based on mouse clicks there, either (although they still send 
> actions to their targets)
>
> There's an [NSWindow setAutodisplay:YES] method which again looks 
> like it's just what I need, except that it's already turned on (I 
> just did it explicitly to be sure, no change).  I've tried setting 
> the window's backing store to BackingStoreNonretained, which also 
> doesn't have any obvious effect.
>
> I'm correct in my assumption that this is supposed to work, yes?  If 
> I create a window, nest a checkbox in it's main view, and start the 
> main event loop, clicks in the checkbox should keep toggling the 
> value of the checkbox and updating the screen, right?  I don't have 
> to do anything special to turn this on, or implement the drawing 
> myself?
>
> --Christopher Kempke
>
> On May 3, 2008, at 8:47 PM, Kyle Sluder wrote:
>

>> On Sat, May 3, 2008 at 7:08 PM, Christopher Kempke
>> <<email_removed>> wrote:

>>> Thanks for the tip, but no go.  It actually makes the behavior 
>>> worse: now
>>> the modal dialog is still drawn, but never becomes active (the 
>>> title bar
>>> never gets dark, and the previously visible (document) window never
>>> deactivates, although the dialog is drawn on top), and the default 
>>> button
>>> doesn't even turn blue.

>>
>> Take a look at -[NSPanel setWorksWhenModal:].  You should be using an
>> NSPanel, not an NSWindow, and must send it this message before doing
>> -[NSApplication runModalForWindow:].  Read this document, entitled
>> "How Modal Windows Work," for more information.
>> http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/Concepts/UsingModalWindows.html#/
>> /apple_ref/doc/uid/20000223
>>
>> --Kyle Sluder
>>

>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlNewbie Question: Controls not redrawing on changes Christopher Kempke May 3, 23:42
mlRe: Newbie Question: Controls not redrawing on changes Nathan Kinsinger May 4, 00:10
mlRe: Newbie Question: Controls not redrawing on changes Michael Ash May 4, 00:25
mlRe: Newbie Question: Controls not redrawing on changes Christopher Kempke May 4, 01:08
mlRe: Newbie Question: Controls not redrawing on changes Kyle Sluder May 4, 05:47
mlRe: Newbie Question: Controls not redrawing on changes Christopher Kempke May 4, 11:19
mlRe: Newbie Question: Controls not redrawing on changes Mike Abdullah May 4, 12:07