You might find it interesting in this thread to compare the actual
contents of a Carbon nib with a Cocoa nib. In Panther and Tiger this
is accomplished from the command line with nibtool, and in Leopard
with ibtool.
A nib is simply an XML document and can be saved as either text or
binary-- the latter of which offers slightly faster execution at the
cost of being human readable.
As in illustration, supppose you have the owners manual for a Dodge
Grand Caravan. That manual tells you the description, location and
purpose of all that vehicle's controls. Now suppose you sell the
Caravan and purchase Honda Odyssey. Will the Caravan's owners manual
be of much help? After all, the Odyssey also has a steering wheel,
cruise control, antilock brake system, spare tire, fues box, etc. But
the problem is that the design of the two vehicles is totally
different and the Caravan manual will be worthless for operation of
the Odyssey.
Hence the difference between Carbon and Cocoa nibs. They are XML
instruction sheets for different beasts. To a Carbon application
Cocoa instructions are worthless, and vice versa.
I created two nibs, one called carbon.nib, and the other cocoa.nib,
in their respective Xcode environments. In each nib I stripped out
the menu bar leaving simply a window with a button. Screenshots for
each are attached. Below are the XML instructions of the two nibs--
Carbon first followed by Cocoa-- saved in ASCII text.
HTH,
Ken
BTW: For FB RAD, TWM still can't be beat in my book.
-------------- CARBON NIB XML CONTENTS ----------------
Last login: Mon Jun 23 22:15:28 on ttyp1
Welcome to Darwin!
[Tiger:~] ken% nibtool -a /Users/ken/Desktop/carbon.nib/
/* Objects */
Objects = {
"Object 1" = {
Class = "NSCustomObject";
CustomClass = "NSApplication";
Name = "Files Owner";
className = "NSApplication";
};
"Object 166" = {
Class = "IBCarbonWindow";
CustomClass = "NSWindow";
Name = "MainWindow";
allowsToolTipsWhenApplicationIsInactive = "0";
autoPositionMask = "0";
autorecalculatesKeyViewLoop = "0";
backingType = "2";
carbonWindowClass = "6";
classID = "<null>";
className = "NSWindow";
compositing = "1";
contentRect = "{{422, 522}, {300, 150}}";
deferred = "1";
doesNotCycle = "0";
dynamicDepthLimit = "0";
frameAutosaveName = "<null>";
hasCloseBox = "1";
hasCollapseBox = "1";
hasHorizontalZoom = "1";
hasMaxSize = "0";
hasMinSize = "0";
hasShadow = "1";
hasSideTitle = "0";
hasVerticalZoom = "1";
helpTagDisplaySide = "0";
helpTagExtendedText = "<null>";
helpTagText = "<null>";
hideOnFullScreen = "0";
hideOnSuspend = "0";
hidesOnDeactivate = "0";
ignoreClicks = "0";
inWindowMenu = "1";
isConstrained = "0";
isLockedIBObject = "0";
isResizable = "1";
liveResize = "1";
maxSize = "{2.14748e+09, 2.14748e+09}";
metal = "0";
minSize = "{0, 22}";
noMetalContentSeparator = "0";
oneShot = "1";
opaqueForEvents = "0";
parameters = "<null>";
receiveActivates = "1";
receiveUpdates = "0";
releasedWhenClosed = "0";
standardHandler = "1";
styleMask = "15";
themeBrush = "0";
title = "Carbon Window";
toolbarButton = "0";
visibleAtLaunch = "0";
wantsToBeColor = "0";
windowPosition = "7";
};
"Object 167" = {
Class = "IBCarbonRootControl";
autoresizingMask = "0";
focusRingType = "0";
frameRect = "{{0, 0}, {300, 150}}";
groupedIBObjectID = "<null>";
isHidden = "0";
isLockedIBObject = "0";
};
"Object 200" = {
Class = "IBCarbonButton";
autoresizingMask = "0";
auxiliaryDictionary = "<null>";
buttonType = "0";
command = "0";
contentResID = "0";
contentType = "0";
controlID = "0";
controlSignature = "0";
controlSize = "0";
controlTitle = "Button";
enabled = "1";
fieldEditor = "0";
focusRingType = "0";
fontStyle = "9999";
foreColor = "<null>";
frameRect = "{{206, 12}, {80, 32}}";
groupedIBObjectID = "<null>";
helpTagDisplaySide = "0";
helpTagExtendedText = "<null>";
helpTagText = "<null>";
hidden = "0";
iconPosition = "6";
isHidden = "0";
isLockedIBObject = "0";
justification = "0";
layoutInfoCopy = "<IBCarbonHILayoutInfo: 0x3d79d0>";
layoutSuspended = "0";
};
}; /* End Objects */
/* Object Hierarchy */
Hierarchy = {
"Object 1 <NSCustomObject> (Files Owner)" = {
"Object -1 <IBFirstResponder> (First Responder)";
"Object 166 <IBCarbonWindow> (MainWindow)" = {
"Object 167 <IBCarbonRootControl>" = {
"Object 200 <IBCarbonButton>";
};
};
};
}; /* End Hierarchy */
/* Connections */
Connections = {
}; /* End Connections */
/* Classes */
Classes = {IBClasses = (); IBVersion = 1; }; /* End Classes */
-------------- COCOA NIB XML CONTENTS ----------------
Last login: Mon Jun 23 22:22:20 on ttyp1
Welcome to Darwin!
[Tiger:~] ken% nibtool -a /Users/ken/Desktop/cocoa.nib/
/* Objects */
Objects = {
"Object 1" = {
Class = "NSCustomObject";
CustomClass = "NSApplication";
Name = "File's Owner";
className = "NSApplication";
};
"Object 2" = {
Class = "NSView";
autoresizingMask = "0";
focusRingType = "0";
frameRect = "{{1, 9}, {300, 150}}";
groupedIBObjectID = "<null>";
isHidden = "0";
isLockedIBObject = "0";
};
"Object 21" = {
Class = "NSWindowTemplate";
CustomClass = "NSWindow";
Name = "Window";
allowsToolTipsWhenApplicationIsInactive = "0";
autoPositionMask = "5";
autorecalculatesKeyViewLoop = "0";
backingType = "2";
className = "NSWindow";
contentRect = "{{374, 549}, {300, 150}}";
deferred = "1";
dynamicDepthLimit = "0";
frameAutosaveName = "<null>";
hasShadow = "1";
hidesOnDeactivate = "0";
isLockedIBObject = "0";
maxSize = "{3.40282e+38, 3.40282e+38}";
minSize = "{213, 129}";
oneShot = "1";
releasedWhenClosed = "0";
styleMask = "14";
title = "Cocoa Window";
visibleAtLaunch = "1";
wantsToBeColor = "0";
};
"Object 248" = {
Class = "NSButton";
Name = "NSButton";
alignment = "2";
allowsMixedState = "0";
alternateImageName = "<null>";
autoresizingMask = "12";
bezelStyle = "1";
bordered = "1";
continuous = "0";
controlSize = "0";
enabled = "1";
focusRingType = "0";
font = "{name = System Font; pointSize = 13}";
frameRect = "{{204, 12}, {82, 32}}";
groupedIBObjectID = "<null>";
iBAlternateTitle = "";
iBBorderType = "1";
iBButtonBehavior = "2";
iBButtonType = "1";
iBTitle = "Button";
imageName = "<null>";
imagePosition = "0";
inset = "2";
isHidden = "0";
isLockedIBObject = "0";
keyEquivalent = "";
keyEquivalentModifierMask = "0";
soundName = "<null>";
state = "0";
tag = "0";
transparent = "0";
};
}; /* End Objects */
/* Object Hierarchy */
Hierarchy = {
"Object 1 <NSCustomObject> (File's Owner)" = {
"Object -1 <IBFirstResponder> (First Responder)";
"Object 21 <NSWindowTemplate> (Window)" = {
"Object 2 <NSView>" = {
"Object 248 <NSButton> (NSButton)";
};
};
};
}; /* End Hierarchy */
/* Connections */
Connections = {
}; /* End Connections */
/* Classes */
Classes = {
IBClasses = ({CLASS = FirstResponder; LANGUAGE = ObjC;
SUPERCLASS = NSObject; });
IBVersion = 1;
}; /* End Classes */
Attachments: