Inheritance: NSWindowController
Ejemplo n.º 1
0
 public WindowBackend()
 {
     this.controller = new WindowBackendController ();
     controller.Window = this;
     StyleMask |= NSWindowStyle.Resizable;
     ContentView.AutoresizesSubviews = true;
     Center ();
 }
Ejemplo n.º 2
0
 public WindowBackend()
 {
     this.controller   = new WindowBackendController();
     controller.Window = this;
     StyleMask        |= NSWindowStyle.Resizable;
     ContentView.AutoresizesSubviews = true;
     Center();
 }
Ejemplo n.º 3
0
        public WindowBackend()
        {
            this.controller   = new WindowBackendController();
            controller.Window = this;
            StyleMask        |= NSWindowStyle.Resizable | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable;
            ContentView.AutoresizesSubviews = true;

            // TODO: do it only if mouse move events are enabled in a widget
            AcceptsMouseMovedEvents = true;

            Center();
        }
Ejemplo n.º 4
0
        public WindowBackend()
        {
            this.controller = new WindowBackendController ();
            controller.Window = this;
            StyleMask |= NSWindowStyle.Resizable | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable;
            ContentView.AutoresizesSubviews = true;

            // TODO: do it only if mouse move events are enabled in a widget
            AcceptsMouseMovedEvents = true;

            Center ();
        }
Ejemplo n.º 5
0
        public WindowBackend()
        {
            this.controller             = new WindowBackendController();
            controller.Window           = this;
            StyleMask                  |= NSWindowStyle.Resizable | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable;
            AutorecalculatesKeyViewLoop = true;

            ContentView.AutoresizesSubviews = true;
            ContentView.Hidden = true;

            // TODO: do it only if mouse move events are enabled in a widget
            AcceptsMouseMovedEvents = true;

            WillClose += delegate {
                OnClosed();
            };

            Center();
        }
Ejemplo n.º 6
0
		public WindowBackend ()
		{
			this.controller = new WindowBackendController ();
			controller.Window = this;
			StyleMask |= NSWindowStyle.Resizable | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable;
			AutorecalculatesKeyViewLoop = true;

			ContentView.AutoresizesSubviews = true;
			ContentView.Hidden = true;

			// TODO: do it only if mouse move events are enabled in a widget
			AcceptsMouseMovedEvents = true;

			WillClose += delegate {
				OnClosed ();
			};

			Center ();
		}
Ejemplo n.º 7
0
        protected override void Dispose(bool disposing)
        {
            if (!disposed && disposing)
            {
                this.disposing = true;
                try
                {
                    if (VisibilityEventsEnabled() && ContentView != null)
                    {
                        ContentView.RemoveObserver(this, HiddenProperty);
                    }

                    // HACK: Xamarin.Mac/MonoMac limitation: no direct way to release a window manually
                    // A NSWindow instance will be removed from NSApplication.SharedApplication.Windows
                    // only if it is being closed with ReleasedWhenClosed set to true but not on Dispose
                    // and there is no managed way to tell Cocoa to release the window manually (and to
                    // remove it from the active window list).
                    // see also: https://bugzilla.xamarin.com/show_bug.cgi?id=45298
                    // WORKAROUND:
                    // bump native reference count by calling DangerousRetain()
                    // base.Dispose will now unref the window correctly without crashing
                                        #if MONOMAC
                    Messaging.void_objc_msgSend(this.Handle, retainSel.Handle);
                                        #else
                    DangerousRetain();
                                        #endif
                    // tell Cocoa to release the window on Close
                    ReleasedWhenClosed = true;
                    // Close the window (Cocoa will do its job even if the window is already closed)
                    Messaging.void_objc_msgSend(this.Handle, closeSel.Handle);
                } finally {
                    this.disposing = false;
                    this.disposed  = true;
                }
            }
            if (controller != null)
            {
                controller.Dispose();
                controller = null;
            }
            base.Dispose(disposing);
        }
Ejemplo n.º 8
0
		protected override void Dispose(bool disposing)
		{
			if (!disposed && disposing)
			{
				this.disposing = true;
				try
				{
					if (VisibilityEventsEnabled() && ContentView != null)
						ContentView.RemoveObserver(this, HiddenProperty);
					
					// HACK: Xamarin.Mac/MonoMac limitation: no direct way to release a window manually
					// A NSWindow instance will be removed from NSApplication.SharedApplication.Windows
					// only if it is being closed with ReleasedWhenClosed set to true but not on Dispose
					// and there is no managed way to tell Cocoa to release the window manually (and to
					// remove it from the active window list).
					// see also: https://bugzilla.xamarin.com/show_bug.cgi?id=45298
					// WORKAROUND:
					// bump native reference count by calling DangerousRetain()
					// base.Dispose will now unref the window correctly without crashing
					#if MONOMAC
					Messaging.void_objc_msgSend(this.Handle, retainSel.Handle);
					#else
					DangerousRetain();
					#endif
					// tell Cocoa to release the window on Close
					ReleasedWhenClosed = true;
					// Close the window (Cocoa will do its job even if the window is already closed)
					Messaging.void_objc_msgSend (this.Handle, closeSel.Handle);
				} finally {
					this.disposing = false;
					this.disposed = true;
				}
			}
			if (controller != null) {
				controller.Dispose ();
				controller = null;
			}
			base.Dispose (disposing);
		}