Package: libgtk2.0-0
Version: 2.12.9-2
Severity: normal

Hi,

Under some circumstances, GtkTreeView fails to properly resize columns which
have their expand property set to TRUE.

In the attached testcase (using pygtk), the middle column has its expand
property set to TRUE and is allowed to ellipsize text. Click on the zoom
button, and see how the column is not resized as it should be. Resize the
window using the bottom-right handle and see how it magically gets resized
as it should.

Stumbled upon this bug while using a GtkTreeView this week in an application;
discussed the problem with Josselin who asked for a testcase for this
particular situation, as it's unclear whether the current patch lacks this
particular case or is broken for this particular case.

Thanks,

JB.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24.3 (SMP w/2 CPU cores)
Locale: LANG=C, [EMAIL PROTECTED] (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages libgtk2.0-0 depends on:
ii  libatk1.0-0           1.22.0-1           The ATK accessibility toolkit
ii  libc6                 2.7-9              GNU C Library: Shared libraries
ii  libcairo2             1.4.14-1           The Cairo 2D vector graphics libra
ii  libcomerr2            1.40.8-1           common error description library
ii  libcupsys2            1.3.6-1            Common UNIX Printing System(tm) - 
ii  libfontconfig1        2.5.0-2            generic font configuration library
ii  libglib2.0-0          2.16.1-1           The GLib library of C routines
ii  libgnutls26           2.2.2-1            the GNU TLS library - runtime libr
ii  libgtk2.0-common      2.12.9-2           Common files for the GTK+ graphica
ii  libjpeg62             6b-14              The Independent JPEG Group's JPEG 
ii  libkrb53              1.6.dfsg.3~beta1-3 MIT Kerberos runtime libraries
ii  libpango1.0-0         1.20.0-1           Layout and rendering of internatio
ii  libpng12-0            1.2.15~beta5-3     PNG library - runtime
ii  libtiff4              3.8.2-7            Tag Image File Format (TIFF) libra
ii  libx11-6              2:1.0.3-7          X11 client-side library
ii  libxcomposite1        1:0.4.0-1          X11 Composite extension library
ii  libxcursor1           1:1.1.9-1          X cursor management library
ii  libxdamage1           1:1.1.1-3          X11 damaged region extension libra
ii  libxext6              2:1.0.4-1          X11 miscellaneous extension librar
ii  libxfixes3            1:4.0.3-2          X11 miscellaneous 'fixes' extensio
ii  libxi6                2:1.1.3-1          X11 Input extension library
ii  libxinerama1          2:1.0.3-1          X11 Xinerama extension library
ii  libxrandr2            2:1.2.2-1          X11 RandR extension library
ii  libxrender1           1:0.9.4-1          X Rendering Extension client libra
ii  zlib1g                1:1.2.3.3.dfsg-11  compression library - runtime

Versions of packages libgtk2.0-0 recommends:
ii  hicolor-icon-theme            0.10-1     default fallback theme for FreeDes
ii  libgtk2.0-bin                 2.12.9-2   The programs for the GTK+ graphica

-- no debconf information
#!/usr/bin/python

import pygtk
pygtk.require('2.0')
import gtk
import pango


def w_delete_destroy_cb(window, user_data):
    gtk.main_quit()

def tb_zoom_in_cb(button):
    gtk.settings_get_default().set_string_property('gtk-font-name', 'Sans 20', '')


window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title('GTK+ TreeView resize bug')
window.set_size_request(800, 600)
window.connect('delete-event', w_delete_destroy_cb)
window.connect('destroy-event', w_delete_destroy_cb)

vbox = gtk.VBox(False, 0)
window.add(vbox)

tbar = gtk.Toolbar()
vbox.pack_start(tbar, False, False, 0)

tb = gtk.ToolButton(gtk.STOCK_ZOOM_IN)
tb.connect('clicked', tb_zoom_in_cb)
tbar.add(tb)

store = gtk.ListStore(str, str, str)
store.append(['col 1 expand False', 'col 2 expand True', 'col 3 expand False'])

tv = gtk.TreeView(store)

tvc = gtk.TreeViewColumn('Col 1')
tv.append_column(tvc)
rdr = gtk.CellRendererText()
tvc.pack_start(rdr, True)
tvc.add_attribute(rdr, 'text', 0)

tvc = gtk.TreeViewColumn('Col 2')
tv.append_column(tvc)
rdr = gtk.CellRendererText()
rdr.set_property('ellipsize', pango.ELLIPSIZE_END)
tvc.pack_start(rdr, True)
tvc.add_attribute(rdr, 'text', 1)
tvc.set_expand(True)

tvc = gtk.TreeViewColumn('Col 3')
tv.append_column(tvc)
rdr = gtk.CellRendererText()
tvc.pack_start(rdr, True)
tvc.add_attribute(rdr, 'text', 2)

sw = gtk.ScrolledWindow()
sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
vbox.pack_start(sw, True, True, 0)

sw.add(tv)

sbar = gtk.Statusbar()
vbox.pack_start(sbar, False, False, 0)

window.show_all()

gtk.main()

Reply via email to