• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Programatically creating windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Programatically creating windows
      • From: Keary Suska <email@hidden>
    • Re: Programatically creating windows
      • From: Michael Babin <email@hidden>
  • Prev by Date: Re: Newbie Q: Why is UIWindow in the AppDelegate not an ivar?
  • Next by Date: first responder stopped working
  • Previous by thread: Rather than NSWorkspaceDidUnmountNotification?
  • Next by thread: Re: Programatically creating windows
  • Index(es):
    • Date
    • Thread