[accerciser/gtkbuilder] convert text attribs to gtkbuilder liststore



commit 955a1e6abe010e5ff70f6664bf040b9c0f32adeb
Author: Eitan Isaacson <eitan ascender com>
Date:   Sun May 10 14:49:25 2009 +0300

    convert text attribs to gtkbuilder liststore
---
 plugins/interface_view.py |   14 +-------------
 plugins/interface_view.ui |   31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/plugins/interface_view.py b/plugins/interface_view.py
index 60ac22f..ee38cb7 100644
--- a/plugins/interface_view.py
+++ b/plugins/interface_view.py
@@ -1170,19 +1170,7 @@ class _SectionText(_InterfaceSection):
     @type ui_xml: gtk.glade.XML
     '''
     # configure text attribute tree view
-    treeview = ui_xml.get_object('treeview_text_attr')
-    self.attr_model = gtk.ListStore(str, str)
-    treeview.set_model(self.attr_model)
-    crt = gtk.CellRendererText()
-    tvc = gtk.TreeViewColumn()
-    tvc.pack_start(crt, True)
-    tvc.set_attributes(crt, text=0)
-    treeview.append_column(tvc)
-    crt = gtk.CellRendererText()
-    tvc = gtk.TreeViewColumn()
-    tvc.pack_start(crt, True)
-    tvc.set_attributes(crt, text=1)
-    treeview.append_column(tvc)
+    self.attr_model = ui_xml.get_object('textattrib_liststore')
 
     self.offset_spin = ui_xml.get_object('spinbutton_text_offset')
     self.text_view = ui_xml.get_object('textview_text')
diff --git a/plugins/interface_view.ui b/plugins/interface_view.ui
index 2b652ec..d549974 100644
--- a/plugins/interface_view.ui
+++ b/plugins/interface_view.ui
@@ -54,6 +54,14 @@
       <column type="gchararray"/>
     </columns>
   </object>
+  <object class="GtkListStore" id="textattrib_liststore">
+    <columns>
+      <!-- column-name gchararray1 -->
+      <column type="gchararray"/>
+      <!-- column-name gchararray2 -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkFrame" id="iface_view_frame">
     <property name="visible">True</property>
     <property name="label_xalign">0</property>
@@ -2303,7 +2311,30 @@
                                           <object class="GtkTreeView" id="treeview_text_attr">
                                             <property name="visible">True</property>
                                             <property name="can_focus">True</property>
+                                            <property name="model">textattrib_liststore</property>
                                             <property name="headers_visible">False</property>
+                                            <child>
+                                              <object class="GtkTreeViewColumn" id="treeviewcolumn13">
+                                                <property name="title">column</property>
+                                                <child>
+                                                  <object class="GtkCellRendererText" id="cellrenderertext14"/>
+                                                  <attributes>
+                                                    <attribute name="text">0</attribute>
+                                                  </attributes>
+                                                </child>
+                                              </object>
+                                            </child>
+                                            <child>
+                                              <object class="GtkTreeViewColumn" id="treeviewcolumn14">
+                                                <property name="title">column</property>
+                                                <child>
+                                                  <object class="GtkCellRendererText" id="cellrenderertext15"/>
+                                                  <attributes>
+                                                    <attribute name="text">1</attribute>
+                                                  </attributes>
+                                                </child>
+                                              </object>
+                                            </child>
                                           </object>
                                         </child>
                                       </object>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]