A model/buffer for GtkEntry
- From: Stef Walter <stef-list memberwebs com>
- To: "gtk-devel-list gnome org" <gtk-devel-list gnome org>
- Subject: A model/buffer for GtkEntry
- Date: Thu, 26 Mar 2009 04:41:28 +0000 (UTC)
A while back  I tackled the possibility of having GtkEntry store it's
text in a application configurable memory buffer. This makes GtkEntry
very useful for use with gnome-keyring and seahorse passwords/secrets .
I've given it another shot, and come up with what I think is a much
better approach. I've implemented a GtkEntryBuffer class (or
GtkEntryModel) which segregates all the text storage and conversion to
A rough outline to give an idea:
GtkEntryBuffer virtual methods
Some questions/points I'd love to have advice on:
1. I think that abstracting out the text storage of GtkEntry is the
right way forward. Does that seem right?
2. Naming: GtkEntryModel or GtkEntryBuffer?
3. As hinted at by the above functions, this moves the conversion to
displayable text into the GtkEntryBuffer class. This helps remove tons
of 'entry->visible' cases in GtkEntry and cleans up the code a whole lot.
4. Interface vs. Subclass: I found that a subclass is far more useful
in this case.
5. GtkEntryBuffer can be used directly, or can be derived from. The
default implementation of the virtual methods acts exactly as one would
expect from GtkEntry.
6. Various properties that were on GtkEntry are now on GtkEntryModel.
Leaving temporary wrappers in GtkEntry is pretty easy. Would we mark
them deprecated? That includes:
I imagine these would live on as convenience functions (and maybe some
of the above):
Bug report filed here with some initial rough patches:
Anything else I'm missing?
] [Thread Prev