From fc9b98f09e7d97ab1fd72b5f4cb3b4ebf0e87c78 Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Thu, 1 Sep 2011 17:58:04 +0200 Subject: [PATCH] TEST : color changing of menu --- Sources/GuiTools/MainWindows/MainWindows.cpp | 18 ++++++++++++++++-- Sources/GuiTools/MainWindows/MenuBar.cpp | 5 +++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Sources/GuiTools/MainWindows/MainWindows.cpp b/Sources/GuiTools/MainWindows/MainWindows.cpp index 4a03538..89f9665 100644 --- a/Sources/GuiTools/MainWindows/MainWindows.cpp +++ b/Sources/GuiTools/MainWindows/MainWindows.cpp @@ -85,7 +85,7 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI) #else ExitIconeFile = "./data/imagesSources/delete-24px.png"; #endif - // TODO : find a good way to chenge the size of an image + // TODO : find a good way to change the size of an image GtkWidget *myImageQuit = gtk_image_new_from_file(ExitIconeFile.c_str()); GtkIconSize mySize = GTK_ICON_SIZE_SMALL_TOOLBAR; //EDN_DEBUG(" plop : " << mySize); @@ -100,7 +100,21 @@ MainWindows::MainWindows(void) : MsgBroadcast("Main Windows", EDN_CAT_GUI) // add the real menu bar gtk_box_pack_start( GTK_BOX (hboxMenu), m_MenuBar.GetWidget(), FALSE, FALSE, 0); - + GdkColor color; + GtkStateType tmpppppp = GTK_STATE_NORMAL; + //GtkStateType tmpppppp = GTK_STATE_ACTIVE; + //GtkStateType tmpppppp = GTK_STATE_PRELIGHT; + //GtkStateType tmpppppp = GTK_STATE_SELECTED; + //GtkStateType tmpppppp = GTK_STATE_INSENSITIVE; + //gdk_color_parse ("green", &color); + //gtk_widget_modify_fg(m_MenuBar.GetWidget(), tmpppppp, &color); + //gdk_color_parse ("blue", &color); + //gtk_widget_modify_bg(m_MenuBar.GetWidget(), tmpppppp, &color); + gdk_color_parse ("red", &color); + gtk_widget_modify_text(m_MenuBar.GetWidget(), tmpppppp, &color); + //gdk_color_parse ("orange", &color); + gtk_widget_modify_base(m_MenuBar.GetWidget(), tmpppppp, &color); + // Add title #endif diff --git a/Sources/GuiTools/MainWindows/MenuBar.cpp b/Sources/GuiTools/MainWindows/MenuBar.cpp index 2f75cc1..40cd309 100644 --- a/Sources/GuiTools/MainWindows/MenuBar.cpp +++ b/Sources/GuiTools/MainWindows/MenuBar.cpp @@ -187,6 +187,11 @@ class MenuBarMain m_message.PushBack(message); // create ITEM GtkWidget *tmpWidget = gtk_image_menu_item_new_from_stock( title, AccelKey::getInstance()->GetAccel() ); + GdkColor color; + gdk_color_parse ("red", &color); + gtk_widget_modify_fg(tmpWidget, GTK_STATE_NORMAL, &color); + gtk_widget_modify_bg(tmpWidget, GTK_STATE_NORMAL, &color); + gtk_widget_modify_text(tmpWidget, GTK_STATE_NORMAL, &color); // set grisage : gtk_widget_set_sensitive(tmpWidget, enable); // add to the menu :