private void RecursiveAttach(int depth, TextView view, TextChildAnchor anchor) { if (depth > 4) { return; } TextView childView = new TextView(view.Buffer); // Event box is to add a black border around each child view EventBox eventBox = new EventBox(); Gdk.RGBA color = new Gdk.RGBA(); color.Parse("black"); eventBox.OverrideBackgroundColor(StateFlags.Normal, color); Alignment align = new Alignment(0.5f, 0.5f, 1.0f, 1.0f); align.BorderWidth = 1; eventBox.Add(align); align.Add(childView); view.AddChildAtAnchor(eventBox, anchor); RecursiveAttach(depth + 1, childView, anchor); }
private void InitializeVideoFrame() { /* Create frame */ frame = new AspectFrame(null, 0.5f, 0.5f, 1.6f, false); frame.ShadowType = ShadowType.None; //Otherwise we have a border around the frame /* Create event box */ EventBox videoFrameEventBox = new EventBox(); videoFrameEventBox.Add(frame); RGBA black = new RGBA(); black.Red = 0; black.Green = 0; black.Blue = 0; black.Alpha = 1; videoFrameEventBox.OverrideBackgroundColor(StateFlags.Normal, black); //So the area outside the video is also black Bin bin = Base.GetWidget(WidgetNames.VideoImageOverlay) as Bin; bin.Add(videoFrameEventBox); bin.ShowAll(); }
private void RecursiveAttach (int depth, TextView view, TextChildAnchor anchor) { if (depth > 4) return; TextView childView = new TextView (view.Buffer); // Event box is to add a black border around each child view EventBox eventBox = new EventBox (); Gdk.RGBA color = new Gdk.RGBA (); color.Parse ("black"); eventBox.OverrideBackgroundColor (StateFlags.Normal, color); Alignment align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f); align.BorderWidth = 1; eventBox.Add (align); align.Add (childView); view.AddChildAtAnchor (eventBox, anchor); RecursiveAttach (depth+1, childView, anchor); }