-
Notifications
You must be signed in to change notification settings - Fork 0
/
fr_bts1.py
62 lines (44 loc) · 1.67 KB
/
fr_bts1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from tkinter import *
from tkinter import ttk
import pyperclip as pc
class Fr_bts1(ttk.Frame):
def __init__(self, parent, con):
super().__init__(parent)
self.con = con
self.bt_cri = ttk.Button(self, text='Criptografar', command=self.criptografar)
self.bt_copy = ttk.Button(self, text='Copiar', command=self.copiar)
self.bt_paste = ttk.Button(self, text='Colar', command=self.colar)
self.bt_del = ttk.Button(self, text='apagar', command=self.deletar)
self.bt_cri.grid(row=0, column=0, columnspan=2, sticky=EW, pady=3, padx=3, ipadx=60)
self.bt_copy.grid(row=1, column=0, sticky=EW, pady=3, padx=3)
self.bt_paste.grid(row=1, column=1, sticky=EW, pady=3, padx=3)
self.bt_del.grid(row=2, column=0, pady=3, padx=3, columnspan=2, sticky=EW)
def criptografar(self):
self.con.criptar()
def copiar(self):
txt = self.con.txt1.get(1.0, END)
pc.copy(txt)
def colar(self):
txt = pc.paste()
self.con.del_txt1()
self.con.txt1.insert(END, txt)
def deletar(self):
self.con.del_txt1()
if __name__ == '__main__':
from main import main
main()
# fazendo teste
# app = Tk()
# # Create a style
# style = ttk.Style(app)
# # Import the tcl file
# app.tk.call('source', './forest_ttk_theme/forest-dark.tcl')
# # Set the theme with the theme_use method
# style.theme_use("forest-dark")
# fr = Fr_btsCrip(app, app)
# fr.grid(sticky=NSEW)
# fr.config(border=20)
# fr.bt_cri.config(width=30)
# from sys import exit
# app.bind('q', exit)
# app.mainloop()