File size: 3,585 Bytes
2fec875
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103


from tkinter import Tk,Frame ,Label,Button,messagebox,Canvas,Text,Scale
from tkinter import  HORIZONTAL

class View():
    def __init__(self,master):
        
        self.width=600
        self.height=600
        
        
        self.root=master
        self.root.geometry("600x600")
        
        self.left_frame=Frame(self.root,width=600)
        self.left_frame.pack_propagate(0)
        self.left_frame.pack(fill='both', side='left', expand='True')
        
        self.retrieval_frame=Frame(self.root,bg='snow3')
        self.retrieval_frame.pack_propagate(0)
        self.retrieval_frame.pack(fill='both', side='right', expand='True')
        
        self.bg_frame=Frame(self.left_frame,bg='snow3',height=600,width=600)
        self.bg_frame.pack_propagate(0)
        self.bg_frame.pack(fill='both', side='top', expand='True')
        
        self.command_frame=Frame(self.left_frame,bg='snow3')
        self.command_frame.pack_propagate(0)
        self.command_frame.pack(fill='both', side='bottom', expand='True')
#        self.command_frame.grid(row=1, column=0,padx=0, pady=0)
        
        self.bg=Canvas(self.bg_frame,width=self.width,height=self.height, bg='gray')
        self.bg.place(relx=0.5, rely=0.5, anchor='center')
        
        self.mani=Canvas(self.retrieval_frame,width=1024,height=1024, bg='gray') 
        self.mani.grid(row=0, column=0,padx=0, pady=42)
        
        self.SetCommand()
        
        
        
    
    def run(self):
        self.root.mainloop()
    
    def helloCallBack(self):
        category=self.set_category.get()
        messagebox.showinfo( "Hello Python",category)
    
    def SetCommand(self):
        
        tmp = Label(self.command_frame, text="neutral", width=10 ,bg='snow3')
        tmp.grid(row=1, column=0,padx=10, pady=10)
        
        tmp = Label(self.command_frame, text="a photo of a", width=10 ,bg='snow3')
        tmp.grid(row=1, column=1,padx=10, pady=10)
        
        self.neutral = Text ( self.command_frame, height=2, width=30)
        self.neutral.grid(row=1, column=2,padx=10, pady=10)
        
        
        tmp = Label(self.command_frame, text="target", width=10 ,bg='snow3')
        tmp.grid(row=2, column=0,padx=10, pady=10)
        
        tmp = Label(self.command_frame, text="a photo of a", width=10 ,bg='snow3')
        tmp.grid(row=2, column=1,padx=10, pady=10)
        
        self.target = Text ( self.command_frame, height=2, width=30)
        self.target.grid(row=2, column=2,padx=10, pady=10)
        
        tmp = Label(self.command_frame, text="strength", width=10 ,bg='snow3')
        tmp.grid(row=3, column=0,padx=10, pady=10)
        
        self.alpha = Scale(self.command_frame, from_=-15, to=25, orient=HORIZONTAL,bg='snow3', length=250,resolution=0.01)
        self.alpha.grid(row=3, column=2,padx=10, pady=10)
        
        
        tmp = Label(self.command_frame, text="disentangle", width=10 ,bg='snow3')
        tmp.grid(row=4, column=0,padx=10, pady=10)
        
        self.beta = Scale(self.command_frame, from_=0.08, to=0.4, orient=HORIZONTAL,bg='snow3', length=250,resolution=0.001)
        self.beta.grid(row=4, column=2,padx=10, pady=10)
        
        self.reset = Button(self.command_frame, text='Reset') 
        self.reset.grid(row=5, column=1,padx=10, pady=10)
        
        
        self.set_init = Button(self.command_frame, text='Accept') 
        self.set_init.grid(row=5, column=2,padx=10, pady=10)

#%%
if __name__ == "__main__":
    master=Tk()
    self=View(master)
    self.run()