I'm working on creating a tool bar menu item that will allow me to select a colour from a pull-down menu. When a new colour is selected I then want to set a different icon in the toolbutton but this never seems to work. The follow snippet shows the functions and type of settings used.
Code:
...
GtkWidget *biggerImg = gtk_image_new_from_file ( "./bigger.png" );
bigger = gtk_tool_button_new (biggerImg,"");
gtk_image_menu_item_set_image ( bigger, biggerImg );
gtk_image_menu_item_set_always_show_image ( bigger, TRUE );
...
....
GtkWidget *smallerImg = gtk_image_new_from_file ( "./smaller.png" );
gtk_image_menu_item_set_image ( bigger,smallerImg );
At first Everything works fine. The icon is reset with no problems but is never displayed! Although the button is empty it is still usable. There are no Gtk+ console messages and the app doesn't crash.
Has anyone encountered this problem and ever solved it? I'm linking against Gtk+2.22.
Will