Commits

Anonymous committed 59160c6

pygi modifications to get examples running

  • Participants
  • Parent commits bb9d079
  • Branches gi

Comments (0)

Files changed (5)

examples/icon-list.py

-from gi.repository import Gtk
+from gi.repository import Gtk, GdkPixbuf
 from pygtkhelpers.ui.objectlist import ObjectList, Cell, Column
 
 
 
 icons = ObjectList([
     Column(title='Stock Data', cells=[
-        Cell('stock_name', Gtk.Pixmap, use_stock=True),
+        #Cell('stock_name', Gtk.Pixmap, use_stock=True),
+        Cell('stock_name', GdkPixbuf.Pixbuf, use_stock=True),
         Cell('stock_name', str),
         ], sorted=False),
     Column('name', str, 'Name', use_markup=True),
     lookup = Gtk.stock_lookup(id)
     if lookup is None:
         continue
-    stock_name, name = Gtk.stock_lookup(id)[:2]
+    stock_name, name = lookup.stock_id, lookup.label
     name = name.replace('_', '')
     icons.append(IconInfo(stock_name, name))
 

pygtkhelpers/debug/dialogs.py

 
         #XXX: add support for showing url's for pastebins
 
-        expander = Gtk.Expander("Exception Details")
+        expander = Gtk.Expander(label="Exception Details")
         self.vbox.pack_start(expander, True, True, 0)
         expander.add(scrolled(self.get_trace_view(exc, tb)))
 

pygtkhelpers/ui/objectlist/column.py

         for mapper in self.mappers:
             mapper(self, object, cell)
 
-    def cell_data_func(self, column, cell, model, iter):
+    #no idea what this last parameter is...seems to always be None.
+    def cell_data_func(self, column, cell, model, iter, _):
         obj = model.get_value(iter, 0)
         self.render(obj, cell)
 
 
     def create_renderer(self, column, objectlist):
         #XXX: extend to more types
-        if self.use_stock or self.type == Gtk.Pixbuf:
+        if self.use_stock or self.type == GdkPixbuf.Pixbuf:
             cell = Gtk.CellRendererPixbuf()
         elif self.use_checkbox or self.use_radio:
             cell = CellRendererToggle(self, objectlist)
             view_cell = cell.create_renderer(self, objectlist)
             view_cell.set_data('pygtkhelpers::column', self)
             #XXX: better control over packing
-            col.pack_start(view_cell, True, True, 0)
+            col.pack_start(view_cell, True)
             col.set_cell_data_func(view_cell, cell.cell_data_func)
         col.set_reorderable(True)
         col.set_sort_indicator(False)
 
         :param objectlist: An ObjectList or ObjectTree
         """
-        objectlist.set_search_equal_func(self._search_equal_func)
+        objectlist.set_search_equal_func(self._search_equal_func, None)
 
     def render_tooltip(self, tooltip, obj):
         """Render the tooltip for this column for an object

pygtkhelpers/ui/objectlist/view.py

         #XXX: make replacable
         self.model = self.create_model()
         self.model_base = self.model
-        self.model_filter = self.model.filter_new()
-        self.model_sort = Gtk.TreeModelSort(self.model_filter)
+        self.model_filter = self.model.filter_new(None)
+        self.model_sort = Gtk.TreeModelSort(model=self.model_filter)
         self.model_tree = self.model_sort
         self.set_model(self.model_sort)
         # setup sorting
             (1, Gdk.EventType.BUTTON_PRESS): 'item-left-clicked',
             (3, Gdk.EventType.BUTTON_PRESS): 'item-right-clicked',
             (2, Gdk.EventType.BUTTON_PRESS): 'item-middle-clicked',
-            (1, Gdk._2BUTTON_PRESS): 'item-double-clicked',
+            (1, Gdk.EventType._2BUTTON_PRESS): 'item-double-clicked',
         }
         signal_name = signal_map.get((event.button, event.type))
         if signal_name is not None:

pygtkhelpers/ui/widgets.py

     def _on_value_changed(self, entry):
         if self._current is  not None:
             self._block = True
-            self.store.set(self._current, 0, entry.get_text())
+            #store.set now accecpts var number of args and should have a -1 as the last argument
+            self.store.set_value(self._current, 0, entry.get_text())
             self._emit_changed()
 
     def _emit_changed(self) :