1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
//GdkColormap *colormap;
GdkColor couleur_fond;
//GtkWidget * widget= GTK_WIDGET(instance->m_black_screen_popup.m_data.m_GTK_black_screen_popup);
GtkWidget * widget= GTK_WIDGET(instance->m_black_screen_popup.m_data.m_GTK_BSP_EventBox);
//colormap = gdk_drawable_get_colormap(widget->window);
// 1 - On fixe la couleur de fond ( vert ici pour l'exemple )
couleur_fond.pixel=0;
couleur_fond.red=0;
couleur_fond.green=32000;
couleur_fond.blue=0;
// 2 - On affecte cette couleur au gc du widget
//gdk_colormap_alloc_color(colormap,&couleur_fond,FALSE,FALSE);
// 3 - On met à jour la couleur de fond
//gdk_gc_set_foreground(widget->style->fg_gc[GTK_WIDGET_STATE(widget)], &couleur_fond);
//4 - On dessine un rectangle pour mettre à jour la couleur de fond.
//gdk_draw_rectangle(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE(widget)], TRUE, widget->allocation.x, widget->allocation.y, widget->allocation.width, widget->allocation.height);
gtk_widget_modify_bg(GTK_WIDGET(widget), GTK_STATE_NORMAL, &couleur_fond);
instance->m_black_screen_popup.display_panel(); |
Partager