mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-20 18:26:23 +00:00
Added method initWithWindow:.. to initialize the template from an actual window instance.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23162 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6dc3d8fd4b
commit
b718aee750
3 changed files with 55 additions and 0 deletions
|
@ -75,6 +75,48 @@ static BOOL _isInInterfaceBuilder = NO;
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) initWithWindow: (NSWindow *)window
|
||||
className: (NSString *)windowClass
|
||||
isDefferred: (BOOL) deferred
|
||||
isOneShot: (BOOL) oneShot
|
||||
isVisible: (BOOL) visible
|
||||
wantsToBeColor: (BOOL) wantsToBeColor
|
||||
autoPositionMask: (int) autoPositionMask
|
||||
{
|
||||
if((self = [super init]) != nil)
|
||||
{
|
||||
if(window != nil)
|
||||
{
|
||||
// object members
|
||||
ASSIGN(_title, [window title]);
|
||||
ASSIGN(_viewClass, NSStringFromClass([[window contentView] class]));
|
||||
ASSIGN(_windowClass, windowClass);
|
||||
ASSIGN(_view, [window contentView]);
|
||||
ASSIGN(_autosaveName, [window frameAutosaveName]);
|
||||
|
||||
// style & size
|
||||
_windowStyle = [window styleMask];
|
||||
_backingStoreType = [window backingType];
|
||||
_maxSize = [window maxSize];
|
||||
_minSize = [window minSize];
|
||||
_windowRect = [window frame];
|
||||
_screenRect = [[NSScreen mainScreen] frame];
|
||||
|
||||
// flags
|
||||
_flags.isHiddenOnDeactivate = [window hidesOnDeactivate];
|
||||
_flags.isNotReleasedOnClose = (![window isReleasedWhenClosed]);
|
||||
_flags.isDeferred = deferred;
|
||||
_flags.isOneShot = oneShot;
|
||||
_flags.isVisible = visible;
|
||||
_flags.wantsToBeColor = wantsToBeColor;
|
||||
_flags.dynamicDepthLimit = [window hasDynamicDepthLimit];
|
||||
_flags.autoPositionMask = autoPositionMask;
|
||||
_flags.savePosition = YES; // not yet implemented.
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue