Hi,

in order to get tooltips in the header of a TreViewColumn I add a Label to
en EventBox. It works but upgrading from Ubuntu 8.04 to 10.04 (pygtk 2.17) I
realized that very ugly border appear (that where not present previously)
as in the attached example.

Does anybody know how to fix the look or to get tooltip in the header of
the column w/o event box?

I attach the example to repoduce the 2 different column headers.

I guess I should get the backgroud style from the label and attach it to the
other, but I'm not sure becouse a standalone label does not show the same
way it shows as a header of a column...

Any hints?

thanks
sandro
*:-)




-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.org        SQLkit home page - PyGTK/python/sqlalchemy

<<attachment: eventbox.png>>

import gtk

class TreeMenu(object):

    def __init__(self):
        
        window = gtk.Window()
        tv = gtk.TreeView() 

        window.add(tv)

        liststore = gtk.ListStore(str, str)
        tv.set_model(liststore)
        liststore.append(['abc', 'xyz'])
        
        self.create_col("with eventbox", 0, tv, eventbox=True)
        self.create_col("simple label", 1, tv, eventbox=False)

        window.show_all()

    def create_col(self, label, n_col, tv, eventbox=False):

        cr = gtk.CellRendererText()
        tc = gtk.TreeViewColumn(label, cr, text=n_col)
        tc.set_clickable(True)
        tv.append_column(tc)
        label = gtk.Label(label)
        if eventbox:
            event_box = gtk.EventBox()
            event_box.add(label)
            tc.set_widget(event_box)
            event_box.show_all()
        else:
            tc.set_widget(label)
            label.show()

        
t = TreeMenu()

gtk.main()
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to