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

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

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

revision 1965 by jpye, Tue Nov 18 03:48:21 2008 UTC revision 1966 by jpye, Mon Dec 1 07:13:49 2008 UTC
# Line 2  import pygtk Line 2  import pygtk
2  pygtk.require('2.0')  pygtk.require('2.0')
3  import gtk  import gtk
4  import ascpy  import ascpy
5    import os.path
6    
7  class BlockType:  class BlockType:
8      """      """
# Line 35  class BlockType: Line 36  class BlockType:
36              elif t[0:min(len(t),4)]=="out:":              elif t[0:min(len(t),4)]=="out:":
37                  self.outputs += [n]                  self.outputs += [n]
38    
39            self.iconfile = None
40            nn = notesdb.getTypeRefinedNotesLang(self.type,ascpy.SymChar("icon"))
41            if nn:
42                n = nn[0].getText()
43                if os.path.exists(n):
44                    self.iconfile = n
45    
46      def get_icon(self, width, height):      def get_icon(self, width, height):
47          return gtk.gdk.pixbuf_new_from_file_at_size("defaultblock.svg",width,height)          f = self.iconfile
48            if self.iconfile is None:
49                f = "defaultblock.svg"
50            return gtk.gdk.pixbuf_new_from_file_at_size(f,width,height)
51    
52      def __getstate__(self):      def __getstate__(self):
53          print "GET STATE ON BLOCKTYPE %s" % self.type.getName()          print "GET STATE ON BLOCKTYPE %s" % self.type.getName()

Legend:
Removed from v.1965  
changed lines
  Added in v.1966

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