// Add a column to the tree view (during the initialization of the tree view)
Add a column to the tree view (during the initialization of the tree view)
// Add a column to the tree view ( during the initialization of the tree view )
func createColumn(title string, id int, toggle bool) *gtk.TreeViewColumn {
	var cellRenderer gtk.ICellRenderer
	var err error
	if !toggle {
		cellRenderer, err = gtk.CellRendererTextNew()
	} else {
		cellRenderer, err = gtk.CellRendererToggleNew()
	}
	if err != nil {
		log.Fatal("Unable to create text cell renderer:", err)
	}
	column, err := gtk.TreeViewColumnNewWithAttribute(title, cellRenderer, "text", id)
	if err != nil {
		log.Fatal("Unable to create cell column:", err)
	}
	return column
}
func createColumn ( title string , id int , toggle bool ) * gtk . TreeViewColumn { var cellRenderer gtk . ICellRenderer var err error if ! toggle { cellRenderer , err = gtk . CellRendererTextNew ( ) } else { cellRenderer , err = gtk . CellRendererToggleNew ( ) } if err != nil { log . Fatal ( " " , err ) } column , err := gtk . TreeViewColumnNewWithAttribute ( title , cellRenderer , " " , id ) if err != nil { log . Fatal ( " " , err ) } return column }
Add a column to the tree view (during the initialization of the tree view)
Add a column to the tree view ( during the initialization of the tree view )