public void RegisterWindow (Window window)
		{
			var width = window.WidthRequest ?? 100;
			var height = window.HeightRequest ?? 50;

			var surface = new GtkSurface (window, window.Left, window.Top, width, height, Gtk.WindowType.Toplevel);
			window.Showed += (sender, e) => surface.ShowSurface ();
			window.Closed += (sender, e) => surface.CloseSurface ();

			window.GetProperty ("Left").DependencyPropertyValueChanged += (sender, e) => surface.Move ((int)window.Left, (int)window.Top);
			window.GetProperty ("Top").DependencyPropertyValueChanged += (sender, e) => surface.Move ((int)window.Left, (int)window.Top);
		}
Example #2
0
        public void RegisterWindow(Window window)
        {
            var width  = window.WidthRequest ?? 100;
            var height = window.HeightRequest ?? 50;

            var surface = new GtkSurface(window, window.Left, window.Top, width, height, Gtk.WindowType.Toplevel);

            window.Showed += (sender, e) => surface.ShowSurface();
            window.Closed += (sender, e) => surface.CloseSurface();

            window.GetProperty("Left").DependencyPropertyValueChanged += (sender, e) => surface.Move((int)window.Left, (int)window.Top);
            window.GetProperty("Top").DependencyPropertyValueChanged  += (sender, e) => surface.Move((int)window.Left, (int)window.Top);
        }
		public void RegisterPopup (Popup popup)
		{
			var width = popup.WidthRequest ?? 100;
			var height = popup.HeightRequest ?? 50;

			var surface = new GtkSurface (popup, 0, 0, width, height, Gtk.WindowType.Popup);
			popup.Opened += (sender, e) =>
			{
				var p = popup.PlacementTarget.PointToScreen (new Point (0, popup.PlacementTarget.DesiredSize.Height));
				surface.Move ((int)(p.X + popup.HorizontalOffset), (int)(p.Y + popup.VerticalOffset));

				surface.ShowSurface ();
			};
			popup.Closed += (sender, e) => surface.Hide ();
		}
Example #4
0
        public void RegisterPopup(Popup popup)
        {
            var width  = popup.WidthRequest ?? 100;
            var height = popup.HeightRequest ?? 50;

            var surface = new GtkSurface(popup, 0, 0, width, height, Gtk.WindowType.Popup);

            popup.Opened += (sender, e) =>
            {
                var p = popup.PlacementTarget.PointToScreen(new Point(0, popup.PlacementTarget.DesiredSize.Height));
                surface.Move((int)(p.X + popup.HorizontalOffset), (int)(p.Y + popup.VerticalOffset));

                surface.ShowSurface();
            };
            popup.Closed += (sender, e) => surface.Hide();
        }