Re: Gtk+ progress bar color



Thanks for your help... Yes i don't understand why gtk doesn't aloow us 
to do some "basic" things..



On 08-03-2017 14:52, Stefan Salewski wrote:
On Wed, 2017-03-08 at 14:18 +0000, Rúben Rodrigues wrote:
I asked to the Google before, but he don't give me nothing about
this
:-). PRELIGHT doesn't work too..
Yes, you are right.

I just took this example:

https://www.spinics.net/lists/gtk/msg00686.html

//gcc -o simple t.c `pkg-config --libs --cflags gtk+-2.0`
#include <gtk/gtk.h>

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_NORMAL, &color);
   gtk_widget_modify_bg(bar,GTK_STATE_PRELIGHT, &color);
   gtk_widget_modify_bg(bar,GTK_STATE_ACTIVE, &color);
   gtk_widget_modify_bg(bar,GTK_STATE_SELECTED, &color);
   gtk_widget_modify_bg(bar,GTK_STATE_INSENSITIVE, &color);

   gtk_widget_modify_fg(bar,GTK_STATE_NORMAL, &color);
   gtk_widget_modify_fg(bar,GTK_STATE_PRELIGHT, &color);
   gtk_widget_modify_fg(bar,GTK_STATE_ACTIVE, &color);
   gtk_widget_modify_fg(bar,GTK_STATE_SELECTED, &color);
   gtk_widget_modify_fg(bar,GTK_STATE_INSENSITIVE, &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;
}

And on my box the bar is still blue!

GTK can be really hard and stubborn sometimes.

I do not have the GTK2 source codes on my box currently, so I can not
look at it currently. Maybe Mr Bassi or someone of the other few
remaining GTK insiders is still following this thread. At least now
your real goal is clear and we have tried it ourself :-)




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