After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 123037 - gtk.ListStore.set_column_types is missing
gtk.ListStore.set_column_types is missing
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: general
1.99.x/2.0.x
Other Linux
: Normal normal
: pygtk-2.0
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2003-09-23 14:43 UTC by Lorenzo Gil Sanchez
Modified: 2005-08-22 12:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Lorenzo Gil Sanchez 2003-09-23 14:43:23 UTC
And we need to wrap this because sometimes we don't want to set the column
types in the __init__ method. Example:

class MyList(gtk.ListStore):
  
   __gproperties__{
       # my custom properties
   }

   def __init__(self):
      self.__gobject_init__()
      # I can't call gtk.ListStore.__init__  here or I will lose my
      # properties
Comment 1 James Henstridge 2003-12-22 16:19:34 UTC
For the example you gave, my preferred solution would be to make
gtk.ListStore.__init__() work for a registered subclass (see bug 129843).

Do you have a use case for set_column_types() appart from the example?

From what Johnathan and Kristian have told me, this function was added
for use by subclasses or code that constructs list stores with
g_object_new().  Changing the column types/number of columns after
construction is not supported.
Comment 2 niemeyer 2004-06-23 14:00:52 UTC
Hello folks, 
 
Is there a reason for not calling ListStore.__init__(self) *before* calling 
self.__gobject_init__()? 
 
Comment 3 Gustavo Carneiro 2004-06-23 14:10:06 UTC
Yes, and the reason is bug 129843.
Comment 4 Johan (not receiving bugmail) Dahlin 2004-06-23 14:11:45 UTC
Yes, if you do that you'll end up calling the constructor twice.

self.__gobject_init__() is basically a hack/workaround. For the proper solution
see bug 129843 as james pointed out.
Comment 5 Gustavo Carneiro 2004-07-03 20:35:22 UTC
Though I have a solution for bug 129843, it really doesn't help in this case
because there are no construct properties in GtkListStore. So...

http://cvs.gnome.org/viewcvs/gnome-python/pygtk/gtk/gtktreeview.override?r1=1.32&r2=1.33&diff_format=u