예제 #1
0
        protected override void OnRealized()
        {
            SetFlag(Gtk.WidgetFlags.Realized);
            GdkWindow = new Gdk.Window(ParentWindow,
                                       new Gdk.WindowAttr {
                WindowType = Gdk.WindowType.Child,
                X          = Allocation.X,
                Y          = Allocation.Y,
                Width      = Allocation.Width,
                Height     = Allocation.Height,
                Wclass     = Gdk.WindowClass.InputOutput,
                Visual     = ParentWindow.Visual,
                Colormap   = ParentWindow.Colormap,
                Mask       = this.Events
                             | EventMask.ExposureMask
                             | EventMask.ButtonPressMask
                             | EventMask.ButtonReleaseMask
                             | EventMask.PointerMotionMask
                             | EventMask.PointerMotionHintMask
                             | EventMask.ScrollMask
                             | EventMask.KeyPressMask
                             | EventMask.LeaveNotifyMask
            },
                                       Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y |
                                       Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap);

            GdkWindow.SetBackPixmap(null, false);
            GdkWindow.UserData = Handle;

            Style.Attach(GdkWindow);
            Style.SetBackground(GdkWindow, Gtk.StateType.Normal);

            OnRealizedChildren();
        }
예제 #2
0
        protected override void OnRealized()
        {
            SetFlag(Gtk.WidgetFlags.Realized);

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Wclass     = WindowClass.InputOutput;
            attributes.Visual     = Visual;
            attributes.Colormap   = Colormap;

            // This enables all events except PointerMotionHitMask which prevents correct behavior
            // of MotionNotifyEvent
            attributes.EventMask = (int)(Gdk.EventMask.AllEventsMask & (~Gdk.EventMask.PointerMotionHintMask));

            Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y
                                            | WindowAttributesType.Visual | WindowAttributesType.Colormap;

            GdkWindow          = new Gdk.Window(ParentWindow, attributes, (int)mask);
            GdkWindow.UserData = Handle;
            GdkWindow.SetBackPixmap(null, false);

            Style = Style.Attach(GdkWindow);
            Style.SetBackground(GdkWindow, StateType.Normal);

            Color = new Cairo.Color(1.0, 1.0, 1.0);
        }
예제 #3
0
		protected override void OnRealized () {
			SetFlag(Gtk.WidgetFlags.Realized);
			
			Gdk.WindowAttr attributes = new Gdk.WindowAttr();
			attributes.WindowType = Gdk.WindowType.Child;
			attributes.X = Allocation.X;
			attributes.Y = Allocation.Y;
			attributes.Width = Allocation.Width;
			attributes.Height = Allocation.Height;
			attributes.Wclass = WindowClass.InputOutput;
			attributes.Visual = Visual;
			attributes.Colormap = Colormap;
			
			// This enables all events except PointerMotionHitMask which prevents correct behavior
			// of MotionNotifyEvent
			attributes.EventMask = (int) (Gdk.EventMask.AllEventsMask & (~Gdk.EventMask.PointerMotionHintMask));
			
			Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y
				| WindowAttributesType.Visual | WindowAttributesType.Colormap;
			
			GdkWindow = new Gdk.Window(ParentWindow, attributes, (int) mask);
			GdkWindow.UserData = Handle;
			GdkWindow.SetBackPixmap(null, false);
			
			Style = Style.Attach(GdkWindow);
			Style.SetBackground(GdkWindow, StateType.Normal);
			
			Color = new Cairo.Color(1.0, 1.0, 1.0);
		}
예제 #4
0
파일: ImageView.cs 프로젝트: hbons/f-spot
        protected override void OnRealized()
        {
            SetFlag (Gtk.WidgetFlags.Realized);
            GdkWindow = new Gdk.Window (ParentWindow,
                    new Gdk.WindowAttr {
                        WindowType = Gdk.WindowType.Child,
                        X = Allocation.X,
                        Y = Allocation.Y,
                        Width = Allocation.Width,
                        Height = Allocation.Height,
                        Wclass = Gdk.WindowClass.InputOutput,
                        Visual = ParentWindow.Visual,
                        Colormap = ParentWindow.Colormap,
                        Mask = this.Events
                            | EventMask.ExposureMask
                            | EventMask.ButtonPressMask
                            | EventMask.ButtonReleaseMask
                            | EventMask.PointerMotionMask
                            | EventMask.PointerMotionHintMask
                            | EventMask.ScrollMask
                            | EventMask.KeyPressMask
                            | EventMask.LeaveNotifyMask
                    },
                    Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y |
                    Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap);

            GdkWindow.SetBackPixmap (null, false);
            GdkWindow.UserData = Handle;

            Style.Attach (GdkWindow);
            Style.SetBackground (GdkWindow, Gtk.StateType.Normal);

            OnRealizedChildren ();
        }