[accerciser/gtkbuilder] changed accessible attribute interface to use GtkBuilder ListStore



commit 47a36068b0566ef6cc491a336759242f2cfd4fb8
Author: Eitan Isaacson <eitan ascender com>
Date:   Sun May 10 13:02:21 2009 +0300

    changed accessible attribute interface to use 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 ccf8a96..f99f507 100644
--- a/plugins/interface_view.py
+++ b/plugins/interface_view.py
@@ -300,19 +300,7 @@ class _SectionAccessible(_InterfaceSection):
     selection.connect('changed', self._onViewSelectionChanged, show_button)
 
     # configure accessible attributes tree view
-    treeview = ui_xml.get_object('accattrib_view')
-    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('accattrib_liststore')
 
   def populateUI(self, acc):
     '''
diff --git a/plugins/interface_view.ui b/plugins/interface_view.ui
index fbd69e7..b74fb98 100644
--- a/plugins/interface_view.ui
+++ b/plugins/interface_view.ui
@@ -18,6 +18,14 @@
       <column type="gint"/>
     </columns>
   </object>
+  <object class="GtkListStore" id="accattrib_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>
@@ -313,7 +321,30 @@
                                       <object class="GtkTreeView" id="accattrib_view">
                                         <property name="visible">True</property>
                                         <property name="can_focus">True</property>
+                                        <property name="model">accattrib_liststore</property>
                                         <property name="headers_visible">False</property>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+                                            <property name="title">column</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext3"/>
+                                              <attributes>
+                                                <attribute name="text">0</attribute>
+                                              </attributes>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkTreeViewColumn" id="treeviewcolumn4">
+                                            <property name="title">column</property>
+                                            <child>
+                                              <object class="GtkCellRendererText" id="cellrenderertext4"/>
+                                              <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]