For more information about how to use custom icons in gtk +-Linux general technology-Linux technology and application, see the following. About using custom icons in gtk +
Recently, I have been studying gtk + programming and want to use custom icons in the software's "menu items" and "tool items, A set of 48*48 png images are provided online and used in programs.
Gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (file_new), gtk_image_new_from_file (DIR_ICO_FILE_NEW ));
Create a menu item with graphics, compile and run it, and find that the menu item is blank and there is no image.
I thought it was an image format problem. After converting a png Image to an xpm format using convert, the system compiled and ran it and found that there was still no image.
However, after using gtk_image_menu_item_new_from_stock () to compile and run the program, an image is displayed before the menu item ......
On google, there is a saying that the image Directory should use an absolute directory. After it is changed to an absolute directory, the problem persists.
This problem makes me very tangle. Most of the materials, such as devhelp, GTK + 2.0 tutorial, GTK study notes, and GTK + 2.0 programming examples, use gtk_image_menu_item_new_from_stock ()
How can I use a custom image ...... Hope you can help me!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service