This is test.m in view mode; [Download] [Up]
#import "test.h"
#import "PowerMenu.h"
@implementation test
- appDidInit:sender
{
id p2, menucell;
menucell = [[PowerMenuCascadeCell alloc] init];
[[menucell setLabelString:"File"] setTag:1000];
p2 = [PowerMenu newPopupMenu];
[p2 setDefaultTarget:self];
[p2 setDefaultAction:@selector(selectionMade:)];
[p2 addSelectionAt:0];
[[[p2 selectionAt:0] setLabel:"saVe"] setTag: 100];
[p2 addSelectionAt:1];
[[[p2 selectionAt:1] setLabel:"cloSe"] setTag: 101];
[p2 addSelectionAt:2];
[[[p2 selectionAt:2] setLabel:"oPen"] setTag: 102];
[p2 addSelectionAt:3];
[[[p2 selectionAt:3] setLabel:"save as"] setTag: 103];
[menucell setSubmenu:p2];
[menubar setCell:menucell];
[menubar setShadowThickness:3.0];
[[menubar superview] display]; // menubar will fit to cells
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.