/[ascend]/trunk/pygtk/canvas/blocklist.py
ViewVC logotype

Diff of /trunk/pygtk/canvas/blocklist.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1950 by jpye, Thu Nov 6 08:54:02 2008 UTC revision 1951 by jpye, Mon Nov 10 02:09:23 2008 UTC
# Line 3  from __future__ import with_statement Line 3  from __future__ import with_statement
3  import os, sys  import os, sys
4    
5  os.chdir(os.path.abspath(os.path.dirname(sys.argv[0])))  os.chdir(os.path.abspath(os.path.dirname(sys.argv[0])))
6    
7  os.environ['ASCENDLIBRARY'] = "../../models"  os.environ['ASCENDLIBRARY'] = "../../models"
8  os.environ['LD_LIBRARY_PATH'] = "../.."  
9    if sys.platform.startswith("win"):
10        os.environ['PATH'] += ";..\.."
11    else:
12        os.environ['LD_LIBRARY_PATH'] = "../.."
13        
14  sys.path.append("..")  sys.path.append("..")
15    
16  if sys.platform.startswith("win"):  if sys.platform.startswith("win"):
# Line 74  import os, os.path, re Line 80  import os, os.path, re
80    
81  import cairo  import cairo
82    
83  gtk.gdk.threads_init()  #gtk.gdk.threads_init()
84    
85  class BlockIconView(gtk.IconView):  class BlockIconView(gtk.IconView):
86      """      """
# Line 90  class BlockIconView(gtk.IconView): Line 96  class BlockIconView(gtk.IconView):
96          self.model = gtk.ListStore(str, gtk.gdk.Pixbuf)          self.model = gtk.ListStore(str, gtk.gdk.Pixbuf)
97          self.app = app          self.app = app
98          self.otank = {}          self.otank = {}
99          thread = threading.RLock()          #thread = threading.RLock()
100          n = 0          n = 0
101          with thread:          #with thread:
102              for b in blocks:          for b in blocks:
103                  n += 1              n += 1
104                  pixbuf = b.get_icon(64,64)              pixbuf = b.get_icon(64,64)
105                  iter = self.model.append([b.type.getName(), pixbuf])              iter = self.model.append([b.type.getName(), pixbuf])
106                  path = self.model.get_path(iter)              path = self.model.get_path(iter)
107                  self.otank[path] = b              self.otank[path] = b
108    
109          gtk.IconView.__init__(self)          gtk.IconView.__init__(self)
110          self.set_model(self.model)          self.set_model(self.model)

Legend:
Removed from v.1950  
changed lines
  Added in v.1951

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22