[pygtk] Reset form

Marcus Habermehl bmh1980de at yahoo.de
Wed Oct 6 21:26:09 WST 2004


Am Mittwoch, den 06.10.2004, 15:13 +0159 schrieb Matthias Teege:
> Moin,
> 
> I have a form with a lot of entry widgets. To clear the form I call
> set_text('') for every entry. Is there a better/faster/better looking
> way to reset a form? I ask because 'set_text('')' is not correct in
> sense of the underlying database where an empty value is NULL not ''. 
> It would be also cool if the entry widget can handle None. At the
> moment I've get a "TypeError: GtkEntry.set_text() argument 1 must be
> string, not None" if I try to set_text(None).

I don't have tested this. But the help of gtk.Entry gives this:
[...]
  Signals from GtkEditable:
    insert-text (gchararray, gint, gpointer)
    delete-text (gint, gint)
[...]

Maybe it helps.

regards

Marcus



More information about the pygtk mailing list