def exit(self,i="null"):
     if self.draw:
         resp = popWin("Save",DATAICONS+"alert.ico","saveIt",(250,80))
         resp.root.mainloop(1)
         if resp.value!=0:
             if resp.value: self.saveImageLayer()
     self.main.destroy()
 def newImage(self,i="null"):
     if self.draw:
         resp = popWin("Save",DATAICONS+"alert.ico","save",(250,80))
         resp.root.mainloop(1)
         if resp.value!=0:
             if resp.value: self.saveImageLayer()
     self.messageUser.config(text="")
     self.addImageDatabase()
     self.draw = False
    def createText(self,event):
        txt = popWin("Write text",DATAICONS+"text.ico","inserttext",(250,110))
        txt.root.mainloop(1)
        self.messageUser.config(text="")
        _font = tkFont.Font(size = self.toolWeight + 10, weight='bold')
        _obj = self.screen.create_text(event.x,event.y, text=txt.value,font = _font, fill=self.activeColor,activefill='red', justify=tk.CENTER, tags='token')
        _objSave = self.screenSave.create_text(event.x,event.y, text=txt.value,font = _font, fill=self.activeColor,activefill='red', justify=tk.CENTER, tags='token')
        
        self.stackElements.append(_obj)
        self.stackElementsSave.append(_objSave)

        self.screen.bind("<ButtonPress-1>",self.breakpoint)
        self.draw = True
    def saveImageLayer(self,i="null"):#TODO
        if self.draw:
            self.screen.update()
            self.screenSave.update()
            txt = popWin("Save",DATAICONS+"save.ico","save",(250,110))
            txt.root.mainloop(1)
            print(txt.value, flush=True)
            
            if txt.value:
                filename = DATASAVES+'tmp'+DEFAULT_EXTENSION
                print('as', self.screenSave.size, flush=True)
                self.screenSave.postscript(file=filename, colormode='color',  height = 770, pagewidth=819)

                img = Image.open(filename)
                print('size ', img.size, flush=True)
                self.saveLayer(img)
                img.save(DATASAVES+'tmp.png', 'png')
                self.draw = False
 def license(self):
     a = popWin("Licencia GNU [English]",DATAICONS+"gnu.ico","license",(600,400),[PROGRAM_TITLE,DATADOCS+"GNU.TXT"])
     a.root.mainloop(0)
 def changelog(self):
     a = popWin("Changelog",DATAICONS+"changelog.ico","changelog",(600,400),[PROGRAM_TITLE,DATADOCS+"CHANGELOG.TXT"])
     a.root.mainloop(0)
 def about(self,i="null"):
     a = popWin("About "+PROGRAM_TITLE,DATAICONS+"coloricon.ico","about",(220,120),[AUTOR,VERSION[0]])
     a.root.mainloop(0)
 def help(self,i="null"):
     a = popWin("help",DATAICONS+"help.ico","help",(600,400),[PROGRAM_TITLE,DATADOCS+"HELP.TXT"])
     a.root.mainloop(0)
 def toolWeightChange(self):
     a = popWin("Tools Weight",DATAICONS+"grosor.ico","weight",(260,450))
     a.root.mainloop(1)
     if a.value!=0:
         self.toolWeight = a.value
         self.infoWeightPencil.config(text=str(a.value))