IconTheme and MIME types



Hello:

	I'm trying to do a small filemanager for a cd recording program. I show
the filenames and icon in a treeview. I want that the icon depends on
the theme of GNOME and the MIME type of the file, like nautilus do.
	I've been reading documentation about Gtk::IconTheme but I haven't
found any good example. Now I have a function that do the following:

Glib::RefPtr<Gdk::Pixbuf> Util::get_icon_from_mime(std::string mime)
{
	Gtk::Invisible w;
	Glib::RefPtr<Gtk::IconTheme> iconTheme =
Gtk::IconTheme::get_for_screen(w.get_screen());
		
	Gtk::IconInfo iconInfo = iconTheme->lookup_icon(mime, 48,
Gtk::ICON_LOOKUP_USE_BUILTIN);

[...]

}

iconTheme->lookup_icon always return an invalid IconInfo.

Please, I need help. Anybody have documentation or an example of how I
must clearly use IconTheme ?

Thanks in advance.

 
-----------------------------------
Diego Fdez. Durán <diego goedi net>
Web: http://www.goedi.net
GPG ID: 90D266BB
-----------------------------------

Attachment: signature.asc
Description: This is a digitally signed message part



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