Render() public method

public Render ( Drawable window, Gdk bounds, StateType state ) : void
window Drawable
bounds Gdk
state StateType
return void
コード例 #1
0
        protected override void Render(Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags)
        {
            if (instance == null || !visible)
            {
                return;
            }
            int width = 0, height = 0;
            int iwidth = cell_area.Width - (int)this.Xpad * 2;

            if (editorCell != null)
            {
                editorCell.GetSize((int)(cell_area.Width - this.Xpad * 2), out width, out height);
            }

            Rectangle bounds = new Rectangle();

            bounds.Width  = width > iwidth ? iwidth : width;
            bounds.Height = height;
            bounds.X      = (int)(cell_area.X + this.Xpad);
            bounds.Y      = cell_area.Y + (cell_area.Height - height) / 2;

            StateType state = GetState(flags);

            if (editorCell != null)
            {
                editorCell.Render(window, bounds, state);
            }
        }
コード例 #2
0
        protected override bool OnExposeEvent(EventExpose evnt)
        {
            bool res = base.OnExposeEvent(evnt);

            cell.Initialize(this, em, property, obj);

            Gdk.Rectangle rect = Allocation;
            rect.Inflate(-3, 0);             // Add some margin

            cell.Render(this.GdkWindow, rect, StateType.Normal);
            return(res);
        }