Files
cappuccino/Tests/Manual/CPMenuTest/AppController.j
T
Klaas Pieter Annema d115d2ef47 fix context menu only closes after two clicks
This is a regression from 73b4c33f05.
Because we were only tracking wether the left mouse button went up after a contextual menu (which is opened with the right mouse)
would only close after the second left mouse up.
2011-07-14 11:15:34 +02:00

44 lines
1.2 KiB
Plaintext

/*
* AppController.j
* CPMenuTest
*
* Created by Alexander Ljungberg on August 31, 2010.
* Copyright 2010, WireLoad, LLC All rights reserved.
*/
@import <Foundation/CPObject.j>
@import "MyView.j"
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [[MyView alloc] initWithFrame:CGRectMakeZero()];
[contentView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[theWindow setContentView:contentView];
var popupButton = [[CPPopUpButton alloc] initWithFrame:CGRectMakeZero()];
[popupButton addItemWithTitle:@"Item 1"];
[popupButton addItemWithTitle:@"Item 2"];
[popupButton addItemWithTitle:@"Item 3"];
[popupButton sizeToFit];
[popupButton setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
[popupButton setCenter:[contentView center]];
[contentView addSubview:popupButton];
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
[CPMenu setMenuBarVisible:YES];
}
@end