#include "menu.h"
#include "window.h"
#include <Xm/RowColumn.h>
#include <Xm/CascadeB.h>

@implementation WDCMenu

- initWithName:(char*)aName managedBy:anObject
{

  if ([anObject isKindOfClassNamed:"WDCWindow"] && [anObject isMainWindow])
    [self setWidget:XmCreateMenuBar([anObject getWidget],
				    aName, 
				    [self getArgList], 
				    [self getNumArgs])];
  else if ([anObject isKindOfClassNamed:"WDCCascadeButton"]) 
    [self setWidget:XmCreatePulldownMenu([anObject getWidget],
					 aName, 
					 [self getArgList], 
					 [self getNumArgs])];
  else
    {
      /* need to finish this part */

      [self setWidget:XmCreatePopupMenu([anObject getWidget],
					   aName, 
					   [self getArgList], 
					   [self getNumArgs])];

    }
  return [self setParentObject: anObject];
}


- unManage
{
  [[self getChildObject] unManage];
  [super unManage];
  return self;
}

- toggleSensitivityWhenNeeded
{
  return [self notImplemented:_cmd];
}


@end


