Re: Newbie Question: Controls not redrawing on changes
Re: Newbie Question: Controls not redrawing on changes
- Subject: Re: Newbie Question: Controls not redrawing on changes
- From: Adam Leonard <email@hidden>
- Date: Sun, 4 May 2008 15:47:56 -0700
Hi,
Did you see Michael Ash's message?
That certainly seems like the problem to me.
Just change backing:NSBackingStoreRetained to NSBackingStoreBuffered
and see if that works.
Adam Leonard
On May 4, 2008, at 3:23 PM, Christopher Kempke wrote:
Thanks to those folks who have tried (unsuccessfully) to help me.
My first post clearly contained too many magenta mackerels, so I've
done what I should have started with and reduced it to a shorter
example.
Given the following complete, nibless, and astoundingly
uninteresting app:
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
// return NSApplicationMain(argc, (const char **) argv);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
NSRect platRect;
platRect.origin.x = 300;
platRect.origin.y = 300;
platRect.size.width = 200;
platRect.size.height = 200;
NSWindow* aWindow = [[NSWindow alloc] initWithContentRect:platRect
styleMask:(NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask)
backing:NSBackingStoreRetained defer:YES];
platRect.origin.x = 20;
platRect.origin.y = 20;
platRect.size.width = 100;
platRect.size.height = 100;
NSControl* ctl = [[NSButton alloc] init];
[(NSButton*)ctl setButtonType:NSSwitchButton];
[(NSButton*)ctl setTitle:@"Check Me"];
[(NSButton*)ctl setState:1];
[ctl setFrame:platRect];
NSView* cview = [aWindow contentView];
[cview addSubview:ctl];
[aWindow makeKeyAndOrderFront:nil];
[NSApp run];
return 0;
}
Clearly I'm missing something critical here (and "artistic talent"
isn't what I'm looking for). What important step am I missing to
make the event loop handle the drawing of my window and checkbox?
--Christopher Kempke
_______________________________________________
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