progress bar color

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

 



Hi,
I'm still having a problem changing the color of a progress bar in one of
my programs using gtk 2.0. I've extracted the offending code into a
trivial test program and I still can't make it work. Can anyone tell me
what I'm doing wrong? I've modified the colors of various other widgets in
the app and these work fine. I'm sure I've done this under gtk1.2 using
modify_style and it worked ok then.

gint main(gint argc,gchar *argv[])
{
	GtkWidget *window;
	GtkWidget* bar;
	GdkColor color;

	gtk_init (&argc,&argv);
	window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
	bar=gtk_progress_bar_new();
	gdk_color_parse("red",&color);
        gtk_widget_modify_bg(bar,GTK_STATE_PRELIGHT, &color);
	gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar),0.5);
	gtk_container_add(GTK_CONTAINER(window),bar);
	gtk_widget_show_all (window);
	gtk_main();
	return 0;
}

Nick Soffe.


_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux