View not visible
View not visible
- Subject: View not visible
- From: spsaxena <email@hidden>
- Date: Thu, 29 Jul 2010 12:31:52 +0530
Sorry for the newb question. I am just trying to create a view
programatically, then add it to window and color it. But when I run it I do
not see the colored view.
Can you please point as to what I am doing wrong. Following is my code -
NSView * windowView = [[self window] contentView];
NSRect windowViewBounds = [windowView bounds];
NSView * subView = [[NSView alloc]
initWithFrame:NSInsetRect(windowViewBounds, 20, 20)];
[windowView addSubview:subView];
NSView * drawView = subView; // subView
[drawView lockFocus];
[[NSColor grayColor] set];
NSRectFill([drawView bounds]);
[drawView unlockFocus];
Thanks,
-sp
_______________________________________________
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