/[ascend]/trunk/pygtk/interface/preferences.py
ViewVC logotype

Diff of /trunk/pygtk/interface/preferences.py

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

revision 172 by johnpye, Sat Jan 7 10:06:13 2006 UTC revision 173 by johnpye, Sat Jan 7 11:20:32 2006 UTC
# Line 26  class Preferences: Line 26  class Preferences:
26              f = open(self.fname, "w");              f = open(self.fname, "w");
27              self.ini.write( f );              self.ini.write( f );
28    
29      def getGeometry(self,displayname,key):      def getGeometrySizePosition(self,displayname,key):
30          try:          try:
31              _g = self.ini.get("Geometry:"+displayname,key)              _g = self.ini.get("Geometry:"+displayname,key)
32          except ConfigParser.NoSectionError:          except ConfigParser.NoSectionError:
# Line 39  class Preferences: Line 39  class Preferences:
39          print "MATCH: ",_m.groups()          print "MATCH: ",_m.groups()
40          return  tuple(int(i) for i in _m.groups())          return  tuple(int(i) for i in _m.groups())
41    
42      def setGeometry(self,displayname,key,width,height,top,left):      def setGeometrySizePosition(self,displayname,key,width,height,top,left):
43          if not self.ini.has_section("Geometry:"+displayname):          if not self.ini.has_section("Geometry:"+displayname):
44              self.ini.add_section("Geometry:"+displayname)              self.ini.add_section("Geometry:"+displayname)
45          self.ini.set("Geometry:"+displayname,key, "%dx%d+%d+%d" % (width, height, top, left) );          self.ini.set("Geometry:"+displayname,key, "%dx%d+%d+%d" % (width, height, top, left) );
46    
47        def getGeometryValue(self,displayname,key):
48            try:
49                _g = self.ini.get("Geometry:"+displayname,key)
50            except ConfigParser.NoSectionError:
51                return None
52            except ConfigParser.NoOptionError:
53                return None
54            return int(_g)
55    
56        def setGeometryValue(self,displayname,key,value):
57            if not self.ini.has_section("Geometry:"+displayname):
58                self.ini.add_section("Geometry:"+displayname)
59            self.ini.set("Geometry:"+displayname,key,str(value))        
60    
61      def getPreferredUnits(self,key):      def getPreferredUnits(self,key):
62          try:          try:
63              _u = self.ini.get("PreferredUnits",key);              _u = self.ini.get("PreferredUnits",key);

Legend:
Removed from v.172  
changed lines
  Added in v.173

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