[pygtk] gtk.Entry fontsize

Leon Bogaert leon at tim-online.nl
Mon Dec 6 08:32:01 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.png
Type: image/png
Size: 55004 bytes
Desc: Untitled Page.png
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20101206/35c94ba9/attachment-0001.png>


More information about the pygtk mailing list