Ejemplo n.º 1
0
 def newFile(self):
     filename = "unsaved document - " + str(self.counter)
     self.counter += 1
     ctext = ColoredText(self.root)
     ctext.pack()
     self.pages[filename] = ctext
     self.titlemap[filename] = None
     self.notebook.add(ctext, text=filename)
Ejemplo n.º 2
0
 def addFile(self, filename):
     try:
         title = path.split(filename)[1]
         f = open(filename, "r")
         self.titlemap[title] = filename
         ctext = ColoredText(self.root)
         txt = f.read()
         ctext.text.insert(END, txt)
         f.close()
         ctext.pack()
         self.pages[title] = ctext
         self.notebook.add(ctext, text=title)
     except:
         pass