Programatically creating windows
Programatically creating windows
- Subject: Programatically creating windows
- From: Development <email@hidden>
- Date: Sat, 13 Dec 2008 21:40:36 -0700
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?
_______________________________________________
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