Hi,
I have created a button and have added label into the button container, when i disable the button the label text is having a 3d effect, It has a white shade on the text. Kindly help in removing this grayed out effect.
Code:
GtkWidget* pButton;
GtkWidget* pLabel;
GdkColor ButtonColour;
// Create Button
pButton = gtk_button_new();
// Fix it on the background
gtk_fixed_put(GTK_FIXED(pBackground), pButton, CHANGEX(nFixedX,nwidth),
CHANGEY(nFixedY,nheight));
gtk_widget_set_size_request(pButton, CHANGEX(nSizeX,nwidth), CHANGEY(nSizeY,nheight));
// Create label to fix
pLabel = gtk_label_new((gchar*) csButtonText.c_str());
gtk_widget_show(pLabel);
// Modify font
gtk_widget_modify_font(pLabel, pFont);
// Set size for the label
gtk_widget_set_size_request(pLabel, CHANGEX((nSizeX/2),nwidth), CHANGEY((nSizeY/2),nheight));
// Justify to center
gtk_label_set_justify(GTK_LABEL(pLabel), GTK_JUSTIFY_CENTER);
// Set line wrap for the Label
gtk_label_set_line_wrap(GTK_LABEL(pLabel), TRUE);
//Add label to Button
gtk_container_add(GTK_CONTAINER(pButton), pLabel);
// Modify BackGround
gtk_widget_modify_bg(pButton, GTK_STATE_NORMAL, &m_Color);
gtk_widget_modify_bg(pButton, GTK_STATE_INSENSITIVE, &m_Black);
gtk_widget_modify_bg(pButton, GTK_STATE_PRELIGHT, &m_Color);
// Modify Foreground
ButtonColour.red = 65535;
ButtonColour.blue= 65535;
ButtonColour.green = 65535;
gtk_widget_modify_fg(pLabel, GTK_STATE_NORMAL, &ButtonColour);
gtk_widget_modify_fg(pLabel, GTK_STATE_PRELIGHT, &ButtonColour);
gtk_widget_modify_fg(pLabel, GTK_STATE_SELECTED, &ButtonColour);
gtk_widget_modify_fg(pLabel, GTK_STATE_ACTIVE, &ButtonColour);
// Change the color of button label in insensitive state
ButtonColour.red = 65535/2;
ButtonColour.blue= 65535/2;
ButtonColour.green = 65535/2;
gtk_widget_modify_fg(pLabel, GTK_STATE_INSENSITIVE, &ButtonColour);