Re: gtk_widget_set_style() and themes



On Tue, 1 Aug 2000, Omar Barneto wrote:

> How can I change a button's selected and prelight color and keep the
> original theme appearance for the normal color? What I'm doing is use
> gtk_widget_get_style(), set the two colors on the style and then
> gtk_widget_set_style(). When I do that, the three colors are apparently
> set and the theme appearance is lost. I'm running under Enlightenment. I

  You write that you set two colors, and then your write that 3 colors are
set... The fact that you're running under E doesn't matter.

  Do you mean that all buttons in your app changed the color or what? If yes,
  you should use gtk_style_copy and modify the returned style. Also note, that
  some themes use pixmaps for drawing widgets, so even if you've chnaged the
  color in some states, appearance of the widget won't change (try your code
  with brushedmetal theme for example).

> found a few probably related functions like gtk_theme_engine_get() etc.,
> but couldn't find any documentation on them. Is there any documentation
> or examples available about how to use this themes API?

  I don't know about documentation on this - but you can look at the gtk
source and at the source of some theme engines (namely pixmap).

  You cna also modify gtkrc for your application (you can name the buttons
using gtk_widget_set_name and then bind particular style in your gtkrc to the
widgets with that name), and then load modified gtkrc using
gtk_rc_set_default_files or gtk_rc_add_default_file.

> Thank you and regards,
> 
> Omar.
> 
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 

 Best regards,
  -Vlad





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