[EMAIL PROTECTED] wrote:
> 
> > [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.
> 
> <code snipped>
> Came up with a similar hack during the holidays myself. This works.
> 
> > 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
> 
> Same here. get_row_style didn't work.
> 
> > style object.  You may want to think about changing colours, rather than
> > fonts, as the CTree seems to support this directly.
> 
> Ya, I see that there's a set_foreground and set_background command there.
> I was hoping to be able to set all these in one operation using
> set_row_style, but it doesn't seem to be possible to set the color in
> GtkStyles with pygtk.

Yes it is.  Just asign to the items in the style.fg or style.bg
sequences:
  style.fg[NORMAL] = some_gdkcolor object

The sequences are special types that will set the appropriate structure
member at the C level.

> 
> This is a bit annoying since I need to be able to override the default
> background color of a GtkText as well, and that seems to require using
> styles.

See above.

> 
> On that note: When inserting text into a text-box it is possible to set
> the fore- and background colors of the text. Is there a way to make the
> background color last until the end of the textbox? Ie. I use a gtk-skin
> which makes the textbox have a blue background. When I insert text with
> white background the background is only present beneath the actual text,
> which gives a blue outline around the lines.

You mean a GtkText widget?  If so, then the insert() method should allow
you to do this.  If you mean a GtkEntry, then it only allows a single
colour (set by the widget's style).

James.

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to