CreateCellRenderer() public static method

public static CreateCellRenderer ( Xwt.Backends.ApplicationContext actx, Gtk.Widget widget, ICellRendererTarget col, object target, ICellViewFrontend view ) : CellViewBackend
actx Xwt.Backends.ApplicationContext
widget Gtk.Widget
col ICellRendererTarget
target object
view ICellViewFrontend
return CellViewBackend
Ejemplo n.º 1
0
 void MapColumn(ListViewColumn col, Gtk.TreeViewColumn tc)
 {
     foreach (var v in col.Views)
     {
         CellUtil.CreateCellRenderer(this, tc, v);
     }
 }
Ejemplo n.º 2
0
 void MapColumn(ListViewColumn col, Gtk.TreeViewColumn tc)
 {
     foreach (var v in col.Views)
     {
         CellUtil.CreateCellRenderer(ApplicationContext, this, tc, v, Widget.Model);
     }
 }
Ejemplo n.º 3
0
 public void SetViews(CellViewCollection views)
 {
     theColumn.Clear();
     foreach (var v in views)
     {
         CellUtil.CreateCellRenderer(ApplicationContext, Frontend, this, theColumn, v);
     }
 }
Ejemplo n.º 4
0
 public void SetViews(CellViewCollection views)
 {
     Widget.Clear();
     foreach (var v in views)
     {
         CellUtil.CreateCellRenderer(this, null, v);
     }
 }
Ejemplo n.º 5
0
 public void SetViews(CellViewCollection views)
 {
     Widget.Clear();
     foreach (var v in views)
     {
         CellUtil.CreateCellRenderer(ApplicationContext, this, null, v, Widget.Model);
     }
 }
Ejemplo n.º 6
0
        void MapTitle(ListViewColumn col, Gtk.TreeViewColumn tc)
        {
            if (col.HeaderView == null)
            {
                tc.Title = col.Title;
            }
            else
            {
                var oldWidget = tc.Widget;
                tc.Widget = CellUtil.CreateCellRenderer(ApplicationContext, col.HeaderView);

                if (tc.Widget != null)
                {
                    // lytic: added show; otherwise the header is not visible
                    tc.Widget.Show();

                    if (oldWidget == null)   // avoid to add events multiple times
                    {
                        tc.Clickable = true;
                        var chk = tc.Widget as Gtk.CheckButton;
                        if (chk != null)
                        {
                            tc.Clicked += (s, e) => chk.Click();
                        }
                        else
                        {
                            tc.Clicked += (s, e) => {
                                col.HeaderView.RaiseButtonPressed(new ButtonEventArgs {
                                    X      = 0,
                                    Y      = 0,
                                    Button = PointerButton.Left
                                });
                            };
                        }
                    }
                    if (false)
                    {
                        // http://stackoverflow.com/questions/6960243/how-do-you-attach-a-popup-menu-to-a-column-header-button-in-gtk2-using-pygobject
                        var top = tc.Widget;
                        // not working: event never fired
                        while (top.Parent != Widget)
                        {
                            top = top.Parent;
                            top.AddEvents((int)Gdk.EventMask.ButtonPressMask);
                            top.ButtonPressEvent += (s, e) => {
                                col.HeaderView.RaiseButtonPressed(new ButtonEventArgs {
                                    X      = e.Event.X,
                                    Y      = e.Event.Y,
                                    Button = (PointerButton)e.Event.Button
                                });
                            };
                        }
                    }
                }
            }
        }
Ejemplo n.º 7
0
 void MapTitle(ListViewColumn col, Gtk.TreeViewColumn tc)
 {
     if (col.HeaderView == null)
     {
         tc.Title = col.Title;
     }
     else
     {
         tc.Widget = CellUtil.CreateCellRenderer(ApplicationContext, col.HeaderView);
     }
 }
Ejemplo n.º 8
0
 void MapColumn(ListViewColumn col, Gtk.TreeViewColumn tc)
 {
     foreach (var k in cellViews.Where(e => e.Value.Column == tc).Select(e => e.Key).ToArray())
     {
         cellViews.Remove(k);
     }
     foreach (var v in col.Views)
     {
         var r = CellUtil.CreateCellRenderer(ApplicationContext, Frontend, this, tc, v);
         cellViews [v] = new CellInfo {
             Column   = tc,
             Renderer = r
         };
     }
 }