Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glade treeview liststore data not visible, can't imagine why

I've got 99% 44/100 of everything working. I have a glade file, I use gtkbuilder to render it and voila it comes up. Everything except the data in my treeview liststore. I notice by default the tree view is not visible, and setting that to true makes a box appear in the tree view area, but I can't get any of my liststore items to display in the treeview. I have some default data in the list store defined in glade, and I programmatically add some too, but nothing ever displays. Is there some visible on/off option I'm missing?

like image 686
stu Avatar asked Nov 29 '10 20:11

stu


2 Answers

To add a cell renderer to your tree view in Glade, right click on the tree view and select "Edit". This brings up the tree view editor. If you click on the "Hierarchy" tab then you can add or remove columns. Add a column and then right click on it for a menu of cell renderers that you can add. This should do the trick.

like image 53
ptomato Avatar answered Sep 28 '22 03:09

ptomato


Just to add to what ptomato said, thought I'd throw in the xml for what I have :

<object class="GtkTreeView" id="portfolio_treeview">
    <property name="visible">True</property>
    <property name="can_focus">True</property>
    <property name="model">portfolio_liststore</property>
    <property name="search_column">0</property>
    <child>
      <object class="GtkTreeViewColumn" id="treeviewcolumn4">
        <property name="title">ID</property>
        <property name="clickable">True</property>
        <property name="sort_indicator">True</property>
        <property name="sort_column_id">0</property>
        <child>
          <object class="GtkCellRendererText" id="cellrenderertext4"/>
          <attributes>
            <attribute name="text">0</attribute>
          </attributes>
        </child>
      </object>
    </child>
</object>
like image 39
Victor Parmar Avatar answered Sep 28 '22 02:09

Victor Parmar