protected void CreateVideoWindow() { if (video_window != null) { return; } var attributes = new Gdk.WindowAttr { WindowType = Gdk.WindowType.Child, X = 0, Y = 0, Width = 0, Height = 0, Visual = Visual, Wclass = Gdk.WindowWindowClass.InputOutput, EventMask = (int)(Gdk.EventMask.ExposureMask | Gdk.EventMask.VisibilityNotifyMask) }; Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual; video_window = new Gdk.Window(null, attributes, attributes_mask); video_window.UserData = Handle; }
protected override void OnRealized() { Gdk.WindowAttr attr; attr = new Gdk.WindowAttr(); attr.X = Allocation.X; attr.Y = Allocation.Y; attr.Width = Allocation.Width; attr.Height = Allocation.Height; attr.EventMask = (int)Events; attr.WindowType = Gdk.WindowType.Child; attr.Wclass = Gdk.WindowClass.InputOutput; attr.Visual = Visual; d_window = new Gdk.Window(ParentWindow, attr, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual); d_window.Background = Style.Background(Gtk.StateType.Normal); d_window.UserData = Handle; GdkWindow = d_window; gtk_widget_set_realized(Handle, true); }
protected override void OnRealized() { WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow; GdkWindow = Parent.GdkWindow; 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 = Gdk.WindowClass.InputOnly; attributes.EventMask = (int)( Gdk.EventMask.PointerMotionMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ExposureMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Wmclass; event_window = new Gdk.Window(GdkWindow, attributes, attributes_mask); event_window.UserData = Handle; Style = Gtk.Rc.GetStyleByPaths(Settings, "*.GtkEntry", "*.GtkEntry", GType); base.OnRealized(); }
static Gdk.Window NewWindow(Gtk.Widget parent, Gdk.WindowClass wclass) { Gdk.WindowAttr attributes; Gdk.WindowAttributesType attributesMask; Gdk.Window win; attributes = new Gdk.WindowAttr(); attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = wclass; attributes.Visual = parent.Visual; attributes.Colormap = parent.Colormap; attributes.Mask = (Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonMotionMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ExposureMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask); attributesMask = Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap; win = new Gdk.Window(parent.GdkWindow, attributes, attributesMask); win.UserData = parent.Handle; if (wclass == Gdk.WindowClass.InputOutput) { parent.Style.Attach(win); } return(win); }
static void Insensitive_Realized(object obj, EventArgs args) { Gtk.Widget widget = (Gtk.Widget)obj; Gdk.WindowAttr attributes = new Gdk.WindowAttr(); attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOnly; attributes.Mask = Gdk.EventMask.ButtonPressMask; Gdk.Window win = new Gdk.Window(widget.GdkWindow, attributes, 0); win.UserData = invis.Handle; win.MoveResize(widget.Allocation); map[widget] = win; map[win] = widget; }
protected override void OnRealized() { SetFlag(Gtk.WidgetFlags.Realized); var attributes = new Gdk.WindowAttr { WindowType = Gdk.WindowType.Child, X = Allocation.X, Y = Allocation.Y, Width = Allocation.Width, Height = Allocation.Height, Wclass = Gdk.WindowClass.InputOutput, Visual = this.Visual, Colormap = this.Colormap, Mask = Gdk.EventMask.VisibilityNotifyMask }; GdkWindow = new Gdk.Window(ParentWindow, attributes, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap); GdkWindow.SetBackPixmap(null, false); GdkWindow.UserData = Handle; attributes = new Gdk.WindowAttr { WindowType = Gdk.WindowType.Child, X = (int)-Hadjustment.Value, Y = (int)-Vadjustment.Value, Width = (int)Math.Max(Width, Allocation.Width), Height = (int)Math.Max(Height, Allocation.Height), Wclass = Gdk.WindowClass.InputOutput, Visual = this.Visual, Colormap = this.Colormap, Mask = Gdk.EventMask.ExposureMask | Gdk.EventMask.ScrollMask | this.Events }; bin_window = new Gdk.Window(GdkWindow, attributes, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap) { UserData = Handle }; Style.Attach(GdkWindow); Style.SetBackground(bin_window, Gtk.StateType.Normal); foreach (var child in children) { child.Widget.ParentWindow = bin_window; } }
protected override void OnRealized() { WidgetFlags |= WidgetFlags.Realized; GdkWindow = Parent.GdkWindow; if (video_window != null) { video_window.Reparent(GdkWindow, 0, 0); video_window.MoveResize(Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); video_window.ShowUnraised(); return; } Gdk.WindowAttr attributes = new Gdk.WindowAttr(); attributes.WindowType = Gdk.WindowType.Child; attributes.X = 0; attributes.Y = 0; attributes.Width = Allocation.Width; attributes.Height = Allocation.Height; attributes.Visual = Visual; attributes.Wclass = Gdk.WindowClass.InputOutput; attributes.Colormap = Colormap; attributes.EventMask = (int)(Gdk.EventMask.ExposureMask | Gdk.EventMask.VisibilityNotifyMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap; video_window = new Gdk.Window(GdkWindow, attributes, attributes_mask); video_window.UserData = Handle; video_window.SetBackPixmap(null, false); if (ServiceManager.PlayerEngine.VideoDisplayContextType == VideoDisplayContextType.GdkWindow) { ServiceManager.PlayerEngine.VideoDisplayContext = video_window.Handle; } else { ServiceManager.PlayerEngine.VideoDisplayContext = IntPtr.Zero; } }
static private void OnRealized(object obj, EventArgs args) { Window window = obj as Window; if (obj == null) { return; } window.WidgetFlags |= WidgetFlags.Realized; Gdk.WindowAttr attrs = new Gdk.WindowAttr(); attrs.Mask = window.Events | (Gdk.EventMask.ExposureMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.StructureMask); attrs.X = window.Allocation.X; attrs.Y = window.Allocation.Y; attrs.Width = window.Allocation.Width; attrs.Height = window.Allocation.Height; attrs.Wclass = Gdk.WindowClass.InputOutput; attrs.Visual = window.Visual; attrs.Colormap = window.Colormap; attrs.WindowType = Gdk.WindowType.Child; Gdk.WindowAttributesType mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; window.GdkWindow = new Gdk.Window(window.ParentWindow, attrs, mask); window.GdkWindow.UserData = window.Handle; window.Style = window.Style.Attach(window.GdkWindow); window.Style.SetBackground(window.GdkWindow, StateType.Normal); // FIXME: gtk-sharp 2.6 // window.GdkWindow.EnableSynchronizedConfigure (); }
protected override void OnRealized() { WidgetFlags |= WidgetFlags.Realized; Gdk.WindowAttr attributes = new Gdk.WindowAttr(); attributes.X = Allocation.X; attributes.Y = Allocation.Y; attributes.Height = Allocation.Height; attributes.Width = Allocation.Width; attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOutput; attributes.Visual = Visual; attributes.TypeHint = (Gdk.WindowTypeHint) 100; // Custom value which means the this gdk window has to use a native window attributes.Colormap = Colormap; attributes.EventMask = (int)(Events | Gdk.EventMask.ExposureMask | Gdk.EventMask.Button1MotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; GdkWindow = new Gdk.Window(ParentWindow, attributes, (int)attributes_mask); GdkWindow.UserData = Handle; Style = Style.Attach(GdkWindow); Style.SetBackground(GdkWindow, State); this.WidgetFlags &= ~WidgetFlags.NoWindow; // Remove the gdk window from the original location and move it to the GtkEmbed view that contains it var gw = GtkMacInterop.GetNSView(this); gw.RemoveFromSuperview(); embedParent.AddSubview(gw); gw.Frame = new CoreGraphics.CGRect(0, 0, embedParent.Frame.Width, embedParent.Frame.Height); }
private void CreateVideoWindow() { if (video_window != null) { return; } var attributes = new Gdk.WindowAttr() { WindowType = Gdk.WindowType.Child, X = 0, Y = 0, Width = 0, Height = 0, Visual = Visual, Wclass = Gdk.WindowClass.InputOutput, Colormap = Colormap, EventMask = (int)(Gdk.EventMask.ExposureMask | Gdk.EventMask.VisibilityNotifyMask) }; Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap; video_window = new Gdk.Window(null, attributes, attributes_mask); video_window.UserData = Handle; video_window.SetBackPixmap(null, false); if (ServiceManager.PlayerEngine.VideoDisplayContextType == VideoDisplayContextType.GdkWindow) { ServiceManager.PlayerEngine.VideoDisplayContext = video_window.Handle; ServiceManager.PlayerEngine.VideoWindowRealize(video_window.Handle); } else { ServiceManager.PlayerEngine.VideoDisplayContext = IntPtr.Zero; } }
protected override void OnRealized() { WidgetFlags |= WidgetFlags.Realized; Gdk.WindowAttr attributes = new Gdk.WindowAttr(); attributes.X = Allocation.X; attributes.Y = Allocation.Y; attributes.Height = Allocation.Height; attributes.Width = Allocation.Width; attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOutput; attributes.Visual = Visual; attributes.Colormap = Colormap; attributes.EventMask = (int)(Events | Gdk.EventMask.ExposureMask | Gdk.EventMask.Button1MotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; GdkWindow = new Gdk.Window(ParentWindow, attributes, (int)attributes_mask); GdkWindow.UserData = Handle; Style = Style.Attach(GdkWindow); Style.SetBackground(GdkWindow, State); GdkWindow.SetBackPixmap(null, true); if (Child != null) { Child.ParentWindow = GdkWindow; } if (grip != null) { grip.ParentWindow = GdkWindow; } }
protected override void OnRealized () { WidgetFlags |= WidgetFlags.Realized; Gdk.WindowAttr attributes = new Gdk.WindowAttr (); attributes.X = Allocation.X; attributes.Y = Allocation.Y; attributes.Height = Allocation.Height; attributes.Width = Allocation.Width; attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOutput; attributes.Visual = Visual; attributes.TypeHint = (Gdk.WindowTypeHint)100; // Custom value which means the this gdk window has to use a native window attributes.Colormap = Colormap; attributes.EventMask = (int)(Events | Gdk.EventMask.ExposureMask | Gdk.EventMask.Button1MotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; GdkWindow = new Gdk.Window (ParentWindow, attributes, (int)attributes_mask); GdkWindow.UserData = Handle; Style = Style.Attach (GdkWindow); Style.SetBackground (GdkWindow, State); this.WidgetFlags &= ~WidgetFlags.NoWindow; // Remove the gdk window from the original location and move it to the GtkEmbed view that contains it var gw = GtkMacInterop.GetNSView (this); gw.RemoveFromSuperview (); embedParent.AddSubview (gw); gw.Frame = new CoreGraphics.CGRect (0, 0, embedParent.Frame.Width, embedParent.Frame.Height); }
private static void OnRealized(object obj, EventArgs args) { Window window = obj as Window; if (obj == null) return; window.WidgetFlags |= WidgetFlags.Realized; Gdk.WindowAttr attrs = new Gdk.WindowAttr (); attrs.Mask = window.Events | (Gdk.EventMask.ExposureMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.StructureMask); attrs.X = window.Allocation.X; attrs.Y = window.Allocation.Y; attrs.Width = window.Allocation.Width; attrs.Height = window.Allocation.Height; attrs.Wclass = Gdk.WindowClass.InputOutput; attrs.Visual = window.Visual; attrs.Colormap = window.Colormap; attrs.WindowType = Gdk.WindowType.Child; Gdk.WindowAttributesType mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; window.GdkWindow = new Gdk.Window (window.ParentWindow, attrs, mask); window.GdkWindow.UserData = window.Handle; window.Style = window.Style.Attach (window.GdkWindow); window.Style.SetBackground (window.GdkWindow, StateType.Normal); // FIXME: gtk-sharp 2.6 // window.GdkWindow.EnableSynchronizedConfigure (); }
protected override void OnRealized() { base.OnRealized(); if (titleWindow == null) { Gdk.WindowAttr attributes = new Gdk.WindowAttr(); Gdk.Rectangle area = TitleArea; attributes.X = area.X; attributes.Y = area.Y; attributes.Width = area.Width; attributes.Height = area.Height; attributes.WindowType = Gdk.WindowType.Temp; attributes.Wclass = Gdk.WindowClass.InputOnly; attributes.OverrideRedirect = true; attributes.EventMask = (int)(Events | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ButtonMotionMask); titleWindow = new Gdk.Window(ParentWindow, attributes, (int)(Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Noredir)); titleWindow.UserData = Handle; if (item.CantClose || item.CantIconify) { titleWindow.Cursor = null; } else { titleWindow.Cursor = new Gdk.Cursor(Display, Gdk.CursorType.Hand2); } } }
protected override void OnRealized() { IsRealized = true; HasWindow = false; Window = Parent.Window; 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 = Gdk.WindowWindowClass.InputOnly; attributes.EventMask = (int)( Gdk.EventMask.PointerMotionMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ScrollMask | Gdk.EventMask.ExposureMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Wmclass; event_window = new Gdk.Window(Window, attributes, attributes_mask); event_window.UserData = Handle; //TODO stylecontext is set from path and path come from name so must inherit but need to be checked! //Style = Gtk.Rc.GetStyleByPaths (Settings, "*.GtkEntry", "*.GtkEntry", GType); base.OnRealized(); }
private void CreateVideoWindow () { if (video_window != null) { return; } var attributes = new Gdk.WindowAttr () { WindowType = Gdk.WindowType.Child, X = 0, Y = 0, Width = 0, Height = 0, Visual = Visual, Wclass = Gdk.WindowClass.InputOutput, Colormap = Colormap, EventMask = (int)(Gdk.EventMask.ExposureMask | Gdk.EventMask.VisibilityNotifyMask) }; Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap; video_window = new Gdk.Window (null, attributes, attributes_mask); video_window.UserData = Handle; video_window.SetBackPixmap (null, false); if (ServiceManager.PlayerEngine.VideoDisplayContextType == VideoDisplayContextType.GdkWindow) { ServiceManager.PlayerEngine.VideoDisplayContext = video_window.Handle; ServiceManager.PlayerEngine.VideoWindowRealize (video_window.Handle); } else { ServiceManager.PlayerEngine.VideoDisplayContext = IntPtr.Zero; } }
static Gdk.Window NewWindow(Gtk.Widget parent, Gdk.WindowClass wclass) { Gdk.WindowAttr attributes; Gdk.WindowAttributesType attributesMask; Gdk.Window win; attributes = new Gdk.WindowAttr (); attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = wclass ; attributes.Visual = parent.Visual; attributes.Colormap = parent.Colormap; attributes.Mask = (Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonMotionMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ExposureMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask); attributesMask = Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap; win = new Gdk.Window (parent.GdkWindow, attributes, attributesMask); win.UserData = parent.Handle; if (wclass == Gdk.WindowClass.InputOutput) parent.Style.Attach (win); return win; }
protected override void OnRealized() { IsRealized = true; HasWindow = false; Window = Parent.Window; 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 = Gdk.WindowWindowClass.InputOnly; attributes.EventMask = (int)( Gdk.EventMask.PointerMotionMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ExposureMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Wmclass; event_window = new Gdk.Window (Window, attributes, attributes_mask); event_window.UserData = Handle; //TODO stylecontext is set from path and path come from name so must inherit but need to be checked! //Style = Gtk.Rc.GetStyleByPaths (Settings, "*.GtkEntry", "*.GtkEntry", GType); base.OnRealized (); }
protected override void OnRealized() { base.OnRealized (); if (titleWindow == null) { Gdk.WindowAttr attributes = new Gdk.WindowAttr (); Gdk.Rectangle area = TitleArea; attributes.X = area.X; attributes.Y = area.Y; attributes.Width = area.Width; attributes.Height = area.Height; attributes.WindowType = Gdk.WindowType.Temp; attributes.Wclass = Gdk.WindowClass.InputOnly; attributes.OverrideRedirect = true; attributes.EventMask = (int) (Events | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ButtonMotionMask); titleWindow = new Gdk.Window (ParentWindow, attributes, (int) (Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Noredir)); titleWindow.UserData = Handle; if (item.CantClose || item.CantIconify) titleWindow.Cursor = null; else titleWindow.Cursor = new Gdk.Cursor (Display, Gdk.CursorType.Hand2); } }
static void Insensitive_Realized (object obj, EventArgs args) { Gtk.Widget widget = (Gtk.Widget)obj; Gdk.WindowAttr attributes = new Gdk.WindowAttr (); attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOnly; attributes.Mask = Gdk.EventMask.ButtonPressMask; Gdk.Window win = new Gdk.Window (widget.GdkWindow, attributes, 0); win.UserData = invis.Handle; win.MoveResize (widget.Allocation); map[widget] = win; map[win] = widget; }
public Window(Gdk.Window parent, Gdk.WindowAttr attributes, Gdk.WindowAttributesType attributes_mask) : this(parent, attributes, (int)attributes_mask) { }
protected override void OnRealized() { SetFlag (Gtk.WidgetFlags.Realized); Gdk.WindowAttr attributes = new Gdk.WindowAttr { WindowType = Gdk.WindowType.Child, X = Allocation.X, Y = Allocation.Y, Width = Allocation.Width, Height = Allocation.Height, Wclass = Gdk.WindowClass.InputOutput, Visual = this.Visual, Colormap = this.Colormap, Mask = Gdk.EventMask.VisibilityNotifyMask }; GdkWindow = new Gdk.Window (ParentWindow, attributes, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap); GdkWindow.SetBackPixmap (null, false); GdkWindow.UserData = Handle; attributes = new Gdk.WindowAttr { WindowType = Gdk.WindowType.Child, X = (int)-Hadjustment.Value, Y = (int)-Vadjustment.Value, Width = (int)Math.Max (width, Allocation.Width), Height = (int)Math.Max (height, Allocation.Height), Wclass = Gdk.WindowClass.InputOutput, Visual = this.Visual, Colormap = this.Colormap, Mask = Gdk.EventMask.ExposureMask | Gdk.EventMask.ScrollMask | this.Events }; bin_window = new Gdk.Window (GdkWindow, attributes, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap); bin_window.UserData = Handle; Style.Attach (GdkWindow); Style.SetBackground (bin_window, Gtk.StateType.Normal); foreach (var child in children) { child.Widget.ParentWindow = bin_window; } }
protected override void OnRealized() { WidgetFlags |= WidgetFlags.Realized; Gdk.WindowAttr attributes = new Gdk.WindowAttr (); attributes.X = Allocation.X; attributes.Y = Allocation.Y; attributes.Height = Allocation.Height; attributes.Width = Allocation.Width; attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOutput; attributes.Visual = Visual; attributes.Colormap = Colormap; attributes.EventMask = (int)(Events | Gdk.EventMask.ExposureMask | Gdk.EventMask.Button1MotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; GdkWindow = new Gdk.Window (ParentWindow, attributes, (int)attributes_mask); GdkWindow.UserData = Handle; Style = Style.Attach (GdkWindow); Style.SetBackground (GdkWindow, State); GdkWindow.SetBackPixmap (null, true); if (Child != null) Child.ParentWindow = GdkWindow; if (grip != null) grip.ParentWindow = GdkWindow; }
protected override void OnRealized() { WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow; GdkWindow = Parent.GdkWindow; 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 = Gdk.WindowClass.InputOnly; attributes.EventMask = (int)( Gdk.EventMask.PointerMotionMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ExposureMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Wmclass; event_window = new Gdk.Window (GdkWindow, attributes, attributes_mask); event_window.UserData = Handle; Style = Gtk.Rc.GetStyleByPaths (Settings, "*.GtkEntry", "*.GtkEntry", GType); base.OnRealized (); }