Re: A model/buffer for GtkEntry



Tristan Van Berkom wrote:
>>  * gtk_entry_buffer_get_visibility
>>  * gtk_entry_buffer_set_visibility
>>  * gtk_entry_buffer_get_invisible_char
>>  * gtk_entry_buffer_set_invisible_char
>>  * gtk_entry_buffer_unset_invisible_char
>>  * gtk_entry_buffer_have_invisible_char
> 
>     I have a feeling these apis should be handled by
> the view (multiple entries on the same buffer
> should be able to control these attributes independently).

That may be the case, and I thought about this myself. One thing in
favor of doing the conversion of 'real text' -> 'display text' in the
model is that it allows subclassed models to do some quite interesting
stuff in the conversion.

For example, you could do what cell phones do as you enter a phone
number: format it automatically as the user enters it. I haven't
explored this idea properly though, but I believe it would be good to
consider while implementing this model infrastructure for GtkEntry.

> Rather than creating a whole new class, is there any reasons
> why a GtkTextBuffer doesnt satisfy the needs of a GtkEntry ?

I guess the same reason why GtkEntry isn't itself based on GtkTextView:
It's too heavy weight and far more complex than what is needed for a
single line text field?

> Interesting work by the way.

Thanks,

Stef



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]