Getting X error on reordering columns in TreeView



Try running this simple program (reordercols.py):

# The purpose of this program is to test reorderable columns in a TreeView.

import gtk

class ReorderableColumns(object):
    def __init__(self):
        self.window = gtk.Window()
        self.window.connect("destroy", gtk.main_quit)
        self.window.set_size_request(240, -1)

        liststore = gtk.ListStore(str, str, str)
        for i in range(10):
            liststore.append(["%d" % i] * 3)

        treeview = gtk.TreeView(liststore)
        for i in range(3):
            cell = gtk.CellRendererText()
            col = gtk.TreeViewColumn('%s' % i, cell, text=i)
            col.set_expand(True)
            col.set_reorderable(True)
            treeview.append_column(col)
        self.window.add(treeview)
        self.window.show_all()

        gtk.main()

    def run(self):
        gtk.main()

app = ReorderableColumns()
app.run()

As soon as I try to drag a column, the program crashes with:

The program 'reordercols.py' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 1289 error_code 8 request_code 56 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Any idea what's wrong?  GTK version 2.24.10 on Ubuntu 12.04.
-- 
Jeffrey Barish


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