[EMAIL PROTECTED] wrote:
> I'm currently trying out using PyGtk for an MH/nmh frontend. I therefore
> have a mailfolder-list currently implemented as a CTree. This works OK.
> I'm trying to make folders with unread messages appear in bold font
> however. Anyone have an idea on how to do that?
In all honesty, I have not done much with CTrees, but I have made the
odd thing bold :) The following is a quick hack that seems to work.
# First, create your list
l = GtkCTree(1, 0, ["Fish"])
# Add a node
foo = l.insert_node(None, None, ['Foo'])
# Copy the list's style object. The style object holds the font
# reference.
style = l.get_style().copy()
# Load the font. The text within quotes is the XLFD.
f = load_font('-*-helvetica-bold-r-normal-*-*-220-*-*-p-*-*-*')
# Change the font in the style object
style.font = f
# Set the style for the node
l.node_set_row_style(foo, style)
The easiest way to get a XLFD is to use gfontsel to select the font that
you want. There is a GtkCTree.node_get_row_style() call, but it didn't
work for me (returned None) so I used the more generic way of creating a
style object. You may want to think about changing colours, rather than
fonts, as the CTree seems to support this directly.
--
Michael JasonSmith http://www.cosc.canterbury.ac.nz/~mpj17/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk