[pygtk] Question about gtk.Entry
Paul Malherbe
paul at tartan.co.za
Tue Apr 25 22:21:25 WST 2006
remi.sassolas at gmail.com wrote:
> On 4/24/06, *Tony Nelson* <tonynelson at georgeanelson.com
> <mailto:tonynelson at georgeanelson.com>> wrote:
>
> I just use entry.modify_fg( gtk.STATE_NORMAL,
> gtk.gdk.Color(0xFFFF, 0, 0)
> ). Also, modify_base does the background.
>
>
>
> Hi,
> Thank you for your answer Tony, these two functions may prove usefull
> indeed !
> But unfortunately it works neither with my real application nor with
> the example I put in my previous mail :-(
> I have tried to modify the first argument of 'modify_fg' (the state of
> the widget) but it didn't work any better.
>
> # File modified_example.py
> import gtk
> import pango
>
> def entry_changed_callback(entry):
> entry.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(0xFFFF, 0, 0))
>
>
> window=gtk.Window()
>
> entry = gtk.Entry()
> entry.connect('changed', entry_changed_callback)
>
> window.add(entry)
> window.show_all()
>
> gtk.main()
> # End of file
>
> Any idea of what's going wrong ?
> --
> Remi
> ------------------------------------------------------------------------
>
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
Hi
change 'modify_fg' to 'modify_base' as suggested by Tony
Your example works ok with me. As sonn as you start entering text the
colour changes.
Cheers
More information about the pygtk
mailing list