0
Good evening, I’m having difficulty with the module Tkinter in python, I’m creating an email generator and I need to position some buttons on the screen but the use of columns do not allow me to position correctly.
These two buttons need to be next to the rest of the left corner but as they share the same column and spacing of the Entry fields that are just above, they do not obey the left shift. I believe there is a way to unlink these buttons from the columns above but I could not find anything yet, thank you from now.
I needed to manipulate it so it would stay this way:
Follows the code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
from tkinter import *
from conversor_caracteres import Conversor
__version__ = '1.0.0'
#xbm, ppm, pgm, gif
#Checkbutton
#partial
#insert
#delete
class Email(object):
def __init__(self,tk):
self.tk = tk
self.tk.title('Gerador de Email GUI')
self.font = ('Verdana', '20', 'bold')
self.font2 = ('Verdana', '14', 'bold')
mainFont=('Verdana','15','bold')
self.msg=Label(self.tk,text='Por favor, informe uma Versão!',font=mainFont)
self.msg.grid(row=0, column=2, columnspan=1)
Label(self.tk,text='Versão:', font=mainFont).grid(row=1, column=1,sticky=W, pady=16)
self.inputVersao=Entry(self.tk, width=20, fg='darkgray',font=mainFont)
self.inputVersao.grid(row=1, column=2, sticky=E+W, pady=3)
self.criarVersao=Button(self.tk, width=8,text='+', font=mainFont, command=self.criarVersao)
self.criarVersao.grid(row=1, column=3, padx=2, pady=3)
Label(self.tk,text='Tópico:', font=mainFont).grid(row=2, column=1, sticky=W, pady=16)
self.inputTopico=Entry(self.tk, width=30, fg='darkgray')
self.inputTopico.grid(row=2,column=2, sticky=E+W, pady=3)
self.inputTopico.config(state='readonly')
self.criarTopico=Button(self.tk, width=8,text='+', font=mainFont, command=self.criarTopico)
self.criarTopico.grid(row=2, column=3, padx=2, pady=3)
Label(self.tk,text='Subtópico:', font=mainFont).grid(row=3, column=1, sticky=W, pady=16)
self.inputSubtopico=Entry(self.tk, width=40, fg='darkgray',font=mainFont)
self.inputSubtopico.grid(row=3,column=2, sticky=E+W, pady=3)
self.inputSubtopico.config(state='readonly')
self.criarSubTopico=Button(self.tk, width=8,text='+',font=mainFont,command=self.criarSubTopico)
self.criarSubTopico.grid(row=3, column=3, padx=2, pady=3)
Label(self.tk,text='Descrição:', font=mainFont).grid(row=4, column=1, sticky=W, pady=16)
self.inputDescricao=Entry(self.tk, width=40, fg='darkgray',font=mainFont)
self.inputDescricao.grid(row=4,column=2, sticky=E+W, pady=3)
self.inputDescricao.config(state='readonly')
self.criarDescricao=Button(self.tk, width=8,text='+',font=mainFont, command=self.criarDescricao)
self.criarDescricao.grid(row=4, column=3, padx=2, pady=3)
self.preview=Button(self.tk, width=10,text='Preview Email', bg="gray", fg="white",font=mainFont)
self.preview.grid(row=5, column=1, padx=0, pady=3, ipadx =20,sticky=SW)
self.alterar=Button(self.tk, width=10,text='Alterar Dados', bg="gray", fg="white",font=mainFont)
self.alterar.grid(row=5, column=2, padx=0, pady=3, ipadx =20, sticky=SW)
self.gerarEmail=Button(self.tk, width=10, command=self.gerarEmail, text='Gerar Email',bg="green", fg="white", font=mainFont)
self.gerarEmail.grid(row=5, column=3, padx=0, pady=3, ipadx =20, sticky=S)
self.resetarEmail=Button(self.tk, width=10,command=self.resetarEmail, text='Resetar Email', bg="red", fg="white", font=mainFont)
self.resetarEmail.grid(row=5, column=4, padx=0, pady=3, ipadx =20)
def criarVersao(self):
print("entrei")
def gerarEmail(self):
pass
def resetarEmail():
pass
def criarHeader(self):
pass
def criarFooter(self):
pass
def criarTopico(self):
pass
def criarSubTopico(self):
pass
def criarDescricao(self):
pass
i = Tk()
Email(i)
i.title('Gerador de Email')
global email
email = []
global preview
preview = []
global conv
conv = Conversor
global arquivo
global versaoDig
versaoDig = False
i.mainloop()