Re: Programatically creating windows
Re: Programatically creating windows
- Subject: Re: Programatically creating windows
- From: Michael Babin <email@hidden>
- Date: Sun, 14 Dec 2008 00:04:23 -0600
On Dec 13, 2008, at 10:40 PM, Development wrote:
I am creating a window more or less from scratch in my main
controller.
The following is the code and all referred to objects are defined in
the xib file save mainWindow which i am obviously creating.
mainWindow = [[NSWindow alloc]initWithContentRect:[mainProto frame]
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered defer:NO];
NSRect winFrame = [mainWindow frame];
NSRect controlFrame =
NSMakeRect(winFrame.size.width-650,winFrame.size.height -27,
[buttonView frame].size.width,[buttonView
frame].size.height);
[docView setEditable:YES];
[mainWindow setBackgroundColor:[NSColor clearColor]];
[mainWindow setOpaque:NO];
[mainWindow setHasShadow:YES];
[mainWindow setIgnoresMouseEvents:NO];
[mainWindow setContentView:mwContent];
[mwContent addSubview:docScroll];
[mwContent addSubview:buttonView positioned:NSWindowBelow
relativeTo:docScroll];
[buttonView setFrame:controlFrame];
[mainWindow makeKeyAndOrderFront:self];
[mainWindow setInitialFirstResponder:docView];
Anyway, the window shows just fine but I cannot for the life of me
get it to allow me to edit the text in the NSTextView. I am at a
loss. Does any one know which step I'm leaving out here?
<http://www.cocoabuilder.com/archive/message/cocoa/2006/6/8/165272>
_______________________________________________
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