Re: [gtk-list] Re: Need help with text entry background



br0ke@shells.clipboard.com (Erik Greenwald) writes:

> Preben Randhol wrote:
> > 
> > I have a text entry which I have defined not editable. In order to
> > clarify for the user that he cannot edit this value I want to change
> > the white background to the normal grey background colour. In this way
> > only when the background is white is it editable...
> 
> like code forge?
> 
> I'd make 2 functions, one to set editable one to set uneditable. in each
> of these functions would be the appropriate gtk_text_set_editable()
> call, as well as the actual background color change, and maybe something
> to realize this?
> 
> 
> the code might end up something like this (I didn't test this)
> 
> void set_ed(GtkWidget *textbox)
> {
>         gtk_text_set_editable(GTK_TEXT(textbox),TRUE);
>         style->bg[NORMAL]={ /* color in here */ };
>         return;
> }
> 
> void unset_ed(GtkWidget *textbox)
> {
>         gtk_text_set_editable(GTK_TEXT(textbox),FALSE);
>         style->bg[NORMAL]={ /* color in here */ };
>         return;
> }
> 
> 
> it may need gtk_widget_realize(textbox) to work right? I d'no :)


[This message was sent a long time ago, so I decided to include it all.] 

This thing about the text entry widget has bothered me for a long
time. The principles of interface design suggest that if a text entry
has two different modes, editable and non editable, the difference
should visible to the user. The widget should look different in
different modes. (e.g. gray when not editable, white otherwise, as
Breben here suggests) 

I think that this should definitely be built in in the text entry
widget. When the programmer calls gtk_text_set_editable the appearance
of the widget changes. There should be no need for separate set_ed and
unset_ed functions. Is this possible to do? What do the others think?

When I showed gtk examples to a Mac user, he almost got a heart attack
when he saw this behavior of the text entry widget! (Otherwise he was
quite pleased with the interface.)

Cheers,

Sami

-- 
Sami Kallio	                    		email: samik@eiffel.com
Interactive Software Engineering, Inc.		Tel: +1 805 685-1006
270 Storke Rd, 2nd fl, Goleta, CA 93117, USA   	Fax: +1 805 685-6869
Customer support: support@eiffel.com           	http://www.eiffel.com



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