[Glade-users] Right way to do custom icons?



Right now in my applications I'm just loading my custom pixmaps in and  
applying them with:

     iconpb = gdk_pixbuf_new_from_file_at_size(iconf, iconsz, iconsz,  
&gerr);
     if (iconpb == NULL) {
         LOGF(0, "failed to load icon '%s': %s", iconf, gerr->message);
         return;
     }
     iconw = gtk_image_new_from_pixbuf(iconpb);
     g_object_unref(iconpb);
     gtk_widget_show(iconw);
     gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), iconw);

Where iconsz is either 16 or 32, hardcoded.

Obviously the problem with this is that I'm not respecting the user's  
global preferences for toolbar icon size and label visibility/position.

Does anyone have any links to sample code or tutorials to do this The  
Right Way?

Thanks in advance,
Jonathan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]