#include "window.h"

@implementation WDCWindow

- initWithName:(char*)aName managedBy:anObject
{
  if ([anObject isKindOfClassNamed:"WDCApplication"])
    {
      isMainWindow=YES;
    }
  else
    {
      isMainWindow=NO;
    }
  [[self setArg : XmNscrollBarDisplayPolicy to : (char*) XmAS_NEEDED]
    setArg : XmNscrollingPolicy to : (char*) XmAUTOMATIC];  
  [super initWithName:aName managedBy:anObject];
  return self;
}

- (WidgetClass)getWidgetClass
{
  return xmMainWindowWidgetClass;
}

- (BOOL)isMainWindow
{
  return isMainWindow;
}

- setAction
{
  return self;
}

- setChildObject:anObject
{
  [super setChildObject:anObject];
  [anObject manage];
  return self;
}

- manage
{
  id child=[self getChildObject];
  if (![child isManaged]) [child manage];
  [super manage];
  return self;
}

- unManage
{
  id child=[self getChildObject];
  if ([child isManaged]) [child unManage];
  [super unManage];
  return self;
}


@end
