What version of GTK are you using? I get result like in the image attached to this email, is this result what you are trying to achive? cheers lör 2005-10-15 klockan 03:02 -0700 skrev funebre (sent by Nabble.com): > Hello, > i'am making an application for showing data received from a sensor. > Is a simple gui composed (for now) from many progressbar. > I have tried to change color of statusbar for obtaining somewat like > this > > but with the code below i obtain this > > wath is my error? > Thanks for replies and sorry for my english :) > > /*code....*/ > #include <gtk/gtk.h> > > GtkWidget *window; > GtkWidget *vbox1,*vbox2,*hbox1,*hbox2,*hbox3; > GtkWidget *pbar_rxacc,*pbar_pxacc,*pbar_rtemp,*pbar_ptemp; > GtkWidget *sep1,*sep2; > > static gboolean delete_event( GtkWidget *widget, GdkEvent *event, > gpointer data ) > { > gtk_main_quit (); > return FALSE; > } > int main( int argc, char *argv[] ) > { > gtk_init (&argc, &argv); > > /*colors & styles for progressbars*/ > GdkColor red; > red.red=65535; > red.green=0; > red.blue=0; > > GdkColor green; > green.green=65535; > green.red=green.blue=0; > > GdkColor blue; > blue.blue=65535; > blue.red=blue.green=0; > > GtkRcStyle *red_st, *blue_st,*green_st; > red_st=gtk_rc_style_new(); > blue_st=gtk_rc_style_new(); > green_st=gtk_rc_style_new(); > int i; > for(i=0;i<5;i++) > { > /*tryng differents alternatives*/ > red_st->color_flags[i]=GTK_RC_FG; > red_st->fg[i]=red; > blue_st->color_flags[i]=GTK_RC_BG; > blue_st->bg[i]=blue; > green_st->color_flags[i]=GTK_RC_BASE; > green_st->base[i]=green; > } > > /*init all widgets*/ > /*box*/ > vbox1=gtk_vbox_new(FALSE,0); > vbox2=gtk_vbox_new(FALSE,0); > hbox1=gtk_hbox_new(FALSE,0); > hbox2=gtk_hbox_new(FALSE,0); > hbox3=gtk_hbox_new(FALSE,0); > > /*progress bar*/ > pbar_rxacc=gtk_progress_bar_new(); > gtk_progress_bar_set_fraction > ((GtkProgressBar*)pbar_rxacc,0.5); > gtk_progress_bar_set_text((GtkProgressBar*)pbar_rxacc,"Roll x > acceleration"); > gtk_widget_modify_style(pbar_rxacc,blue_st); > > pbar_rtemp=gtk_progress_bar_new(); > > gtk_progress_bar_set_orientation((GtkProgressBar*)pbar_rtemp,GTK_PROGRESS_BOTTOM_TO_TOP); > gtk_progress_bar_set_text((GtkProgressBar*)pbar_rtemp,"Roll > \nsensor\ntemperature"); > gtk_widget_modify_style(pbar_rtemp,red_st); > > pbar_pxacc=gtk_progress_bar_new(); > gtk_progress_bar_set_fraction > ((GtkProgressBar*)pbar_pxacc,0.5); > gtk_progress_bar_set_text((GtkProgressBar*)pbar_pxacc,"Pitch x > acceleration"); > gtk_widget_modify_style(pbar_pxacc,green_st); > > pbar_ptemp=gtk_progress_bar_new(); > > gtk_progress_bar_set_orientation((GtkProgressBar*)pbar_ptemp,GTK_PROGRESS_BOTTOM_TO_TOP); > gtk_progress_bar_set_text((GtkProgressBar*)pbar_ptemp,"Pitch > \nsensor\ntemperature"); > gtk_widget_modify_style(pbar_ptemp,red_st); > > /*separators*/ > sep1= gtk_hseparator_new (); > sep2= gtk_vseparator_new (); > > /*packing widgets in the boxes*/ > gtk_box_pack_start((GtkBox*)vbox1,hbox1,TRUE,TRUE,5); > gtk_box_pack_start((GtkBox*)vbox1,sep1,FALSE,TRUE,5); > gtk_box_pack_start((GtkBox*)vbox1,hbox2,TRUE,TRUE,5); > gtk_box_pack_start((GtkBox*)hbox2,vbox2,TRUE,TRUE,5); > gtk_box_pack_start((GtkBox*)vbox2,pbar_rxacc,FALSE,TRUE,5); > gtk_box_pack_start((GtkBox*)vbox2,pbar_pxacc,FALSE,TRUE,5); > gtk_box_pack_start((GtkBox*)hbox2,sep2,FALSE,TRUE,5); > gtk_box_pack_start((GtkBox*)hbox2,hbox3,FALSE,TRUE,5); > gtk_box_pack_end((GtkBox*)hbox3,pbar_rtemp,FALSE,TRUE,5); > gtk_box_pack_end((GtkBox*)hbox3,pbar_ptemp,FALSE,TRUE,5); > > window = gtk_window_new (GTK_WINDOW_TOPLEVEL); > g_signal_connect (G_OBJECT (window), "delete_event",G_CALLBACK > (delete_event), NULL); > gtk_container_add (GTK_CONTAINER (window), vbox1); > gtk_widget_show_all(window); > > gtk_main (); > > return 0; > } > > ______________________________________________________________________ > Sent from the Gtk+ - General forum at Nabble.com. > _______________________________________________ > gtk-list mailing list > gtk-list gnome org > http://mail.gnome.org/mailman/listinfo/gtk-list
Attachment:
test.png
Description: PNG image