Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

printf

macrumors regular
Original poster
Aug 27, 2008
105
0
i like breaking all the rules - is there a way to just create a window 'from scratch' with no nib to serve as a template?

CreateWindowFromNib has it's uses in some instances for me - but since this is for a win32 port and there are times where it'd be more convenient to do it 'from scratch'. plus, it would just be nice to know how - especially if such a method were able to be used for other objects like buttons, text boxes, etc..

(note: carbon is my weapon of choice - despite the fine folk that suggested otherwise), so if you've got a related example, that would be nice - but I'll take anything ya got!
 

Catfish_Man

macrumors 68030
Sep 13, 2001
2,579
2
Portland, OR
Sure, just (Cocoa, sorry; my Carbon is not so great) instantiate an NSWindow, add your views to its content view using addSubview:, and then call makeKeyAndOrderFront or similar.
 

printf

macrumors regular
Original poster
Aug 27, 2008
105
0
think i just found another way:

Code:
OSStatus CreateNewWindow (
   WindowClass windowClass,
   WindowAttributes attributes,
   const Rect * contentBounds,
   WindowRef * outWindow
);

sorry, still familiarizing myself with the xcode api reference - too used to msdn!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.