Exemplo n.º 1
0
		public static CellView NewWithText(string text)
		{
			IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup (text);
			CellView result = new CellView (gtk_cell_view_new_with_text(native_text));
			GLib.Marshaller.Free (native_text);
			return result;
		}
Exemplo n.º 2
0
        public static CellView NewWithText(string text)
        {
            IntPtr   native_text = GLib.Marshaller.StringToPtrGStrdup(text);
            CellView result      = new CellView(gtk_cell_view_new_with_text(native_text));

            GLib.Marshaller.Free(native_text);
            return(result);
        }
Exemplo n.º 3
0
 protected Gtk.CellRenderer GetCellRenderer(CellView cell)
 {
     return cellViews [cell].Renderer.CellRenderer;
 }
Exemplo n.º 4
0
 protected Gtk.TreeViewColumn GetCellColumn(CellView cell)
 {
     return cellViews [cell].Column;
 }
Exemplo n.º 5
0
 protected Gtk.TreeViewColumn GetCellColumn(CellView cell)
 {
     CellInfo ci;
     if (cellViews.TryGetValue (cell, out ci))
         return ci.Column;
     return null;
 }
Exemplo n.º 6
0
		public static Gtk.Widget CreateCellRenderer (ApplicationContext actx, CellView view)
		{
			if (view is TextCellView) {
				Gtk.Label lab = new Gtk.Label ();
				lab.Xalign = 0;
//				lab.Text = ((TextCellView)view).TextField;
				return lab;
			}
			throw new NotImplementedException ();
		}
Exemplo n.º 7
0
 public static Gtk.CellRenderer CreateCellRenderer(ApplicationContext actx, ICellRendererTarget col, object target, CellView view, Gtk.TreeModel model)
 {
     if (view is TextCellView) {
         Gtk.CellRendererText cr = new Gtk.CellRendererText ();
         if (((TextCellView)view).Editable) {
             cr.Editable = true;
             cr.Edited += (o, args) => {
                 Gtk.TreeIter iter;
                 if (model.GetIterFromString (out iter, args.Path))
                     model.SetValue (iter, ((TextCellView)view).TextField.Index, args.NewText);
             };
         }
         col.PackStart (target, cr, false);
         col.AddAttribute (target, cr, "text", ((TextCellView)view).TextField.Index);
         return cr;
     }
     else if (view is CheckBoxCellView) {
         Gtk.CellRendererToggle cr = new Gtk.CellRendererToggle ();
         col.PackStart (target, cr, false);
         col.AddAttribute (target, cr, "active", ((CheckBoxCellView)view).ActiveField.Index);
         return cr;
     }
     else if (view is ImageCellView) {
         CellRendererImage cr = new CellRendererImage (actx);
         col.PackStart (target, cr, false);
         col.AddAttribute (target, cr, "image", ((ImageCellView)view).ImageField.Index);
         return cr;
     }
     else if (view is CanvasCellView) {
         var canvas = (CanvasCellView) view;
         var cr = new CustomCellRenderer (canvas);
         col.PackStart (target, cr, false);
         col.SetCellDataFunc (target, cr, delegate (CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
             cr.LoadData (cell_layout, cell, tree_model, iter);
             ((CanvasCellView) view).Initialize (cr);
         });
         return cr;
     }
     throw new NotSupportedException ("Unknown cell view type: " + view.GetType ());
 }