Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.75 KB | None | 0 0
  1. public void smartPixTextColumnData(TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) {
  2.         GLib.Object o = null;
  3.         string title = "";
  4.         tree_model.get(iter, 0, out o, 2, out title);
  5.        
  6.         if(cell is CellRendererText) {
  7.             string text;
  8.             tree_model.get(iter, 2, out text);
  9.             ((CellRendererText)cell).text = text;
  10.         }
  11.         else if(cell is CellRendererPixbuf && title == "Song Info") {
  12.         stdout.printf("song info\n");
  13.             ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("info", IconSize.MENU);
  14.         }
  15.         else if(cell is CellRendererPixbuf && title == "Collection") {
  16.             stdout.printf("collection\n");
  17.             ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("media-audio", IconSize.MENU);
  18.         }
  19.         else if(cell is CellRendererPixbuf && title == "Queue") {
  20.             stdout.printf("queue\n");
  21.             ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("media-audio", IconSize.MENU);
  22.         }
  23.         else if(cell is CellRendererPixbuf && title == "Already Played") {
  24.             stdout.printf("already played\n");
  25.             ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("playlist-automatic", IconSize.MENU);
  26.         }
  27.         else if(cell is CellRendererPixbuf && o is SmartPlaylist) {
  28.             stdout.printf("smart playlist\n");
  29.             ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("playlist-automatic", IconSize.MENU);
  30.         }
  31.         else if(cell is CellRendererPixbuf && o is Playlist) {
  32.             stdout.printf("playlist\n");
  33.             ((CellRendererPixbuf)cell).pixbuf = get_pixbuf_from_stock("playlist", IconSize.MENU);
  34.         }
  35.     }
  36.    
  37.     Gdk.Pixbuf get_pixbuf_from_stock (string stock_id, Gtk.IconSize size)
  38.     {
  39.       Gdk.Pixbuf pixbuf;
  40.      
  41.       pixbuf = this.render_icon(stock_id, size, null);
  42.      
  43.       if(pixbuf == null)
  44.         stdout.printf("null\n");
  45.      
  46.       return pixbuf;
  47.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement