Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void smartPixTextColumnData(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
- GLib.Object o = null;
- string title = "";
- tree_model.get(iter, 0, out o, 2, out title);
- if(cell is CellRendererText) {
- string text;
- tree_model.get(iter, 2, out text);
- ((CellRendererText)cell).text = text;
- }
- else if(cell is CellRendererPixbuf && title == "Song Info") {
- stdout.printf("song info\n");
- ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("info", IconSize.MENU);
- }
- else if(cell is CellRendererPixbuf && title == "Collection") {
- stdout.printf("collection\n");
- ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("media-audio", IconSize.MENU);
- }
- else if(cell is CellRendererPixbuf && title == "Queue") {
- stdout.printf("queue\n");
- ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("media-audio", IconSize.MENU);
- }
- else if(cell is CellRendererPixbuf && title == "Already Played") {
- stdout.printf("already played\n");
- ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("playlist-automatic", IconSize.MENU);
- }
- else if(cell is CellRendererPixbuf && o is SmartPlaylist) {
- stdout.printf("smart playlist\n");
- ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("playlist-automatic", IconSize.MENU);
- }
- else if(cell is CellRendererPixbuf && o is Playlist) {
- stdout.printf("playlist\n");
- ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("playlist", IconSize.MENU);
- }
- }
- Gdk.Pixbuf get_pixbuf_from_stock (string stock_id, Gtk.IconSize size)
- {
- Gdk.Pixbuf pixbuf;
- pixbuf = this.render_icon(stock_id, size, null);
- if(pixbuf == null)
- stdout.printf("null\n");
- return pixbuf;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement