コード例 #1
0
        public MacMenuButton(IMenuButtonEventSink eventSink, ApplicationContext context)
        {
            this.eventSink = eventSink;
            this.context   = context;

            Cell = new ColoredPopUpButtonCell();

            PullsDown  = true;
            Activated += delegate {
                context.InvokeUserCode(eventSink.OnClicked);
            };

            NSNotificationCenter.DefaultCenter.AddObserver((NSString)"NSPopUpButtonWillPopUpNotification", CreateMenu, this);
            AddItem("");
        }
コード例 #2
0
ファイル: MenuButtonBackend.cs プロジェクト: m13253/xwt
		public MacMenuButton (IMenuButtonEventSink eventSink, ApplicationContext context)
		{
			this.eventSink = eventSink;
			this.context = context;

			Cell = new ColoredPopUpButtonCell ();

			PullsDown = true;
			Activated += delegate {
				context.InvokeUserCode (delegate {
					eventSink.OnClicked ();
				});
			};

			NSNotificationCenter.DefaultCenter.AddObserver ((NSString)"NSPopUpButtonWillPopUpNotification", CreateMenu, this);
			AddItem ("");
		}