[pygtk] gtk.Entry fontsize

Leon Bogaert leon at tim-online.nl
Mon Dec 6 17:15:58 WST 2010


I've been trying to edit a gtk.Enyry's fontsize by doing something like this:

gtkEntry.modify_font(pango.FontDescription('courier Medium 32'))

But the fontsize (and family) of the gtk entry doesn't change.

This works:
        gtk.rc_parse_string("""
            style "entryTime_style"
            {
                font_name="Sans Serif 24"
            }
            class "GtkEntry" style "entryTime_style"
        """);

But I would rather copy the pango context and just change the fontsize. But I can't get that working. Does anyone has a working example?

Also, is it possible to change the (inner) background of an entry to transparent?

I'm trying to create a window like the "Timer" in the attachment.

Regards,
Leon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Untitled Page.jpg
Type: image/jpeg
Size: 28267 bytes
Desc: Untitled Page.jpg
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20101206/55b4f388/attachment-0001.jpg>


More information about the pygtk mailing list