Re: Changing background colors



>Another example is text color of button. GtkButton doesn't has built in 
>support for text, instead, it does that by placing a GtkLabel into the 
>button. So if you want to change the color of text, you need to change the 
>text color for that label. I found this method is very inconvenient, because 
>it conflicts user(app developer)'s intuitive thinking and forces them to 
>check widget implementation details. 

this isn't true. the problem with this "intuitive thinking" is that it
starts out thinking that a button is a widget with text in it.

that's not what a button is. a button is a widget that when clicked
upon (or some equivalent keyboard action is carried out), emits
certain signals. what is displayed inside the button ... this has
nothing to do with the button itself. it could be a label, it could be
a pixmap image, it could be a table that contains other widgets of
various types, etc. etc.

abstraction is good, specialization is a necessary evil. you want a
specialized button that *only* has a text label. GTK gives you the
abstract button that can contain anything you might want.

--p




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