<reponame>gabriel-baltazar/Projeto-Calculadora<gh_stars>1-10
#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 5.4
#  in conjunction with Tcl version 8.6
#    Jul 26, 2020 10:00:47 PM -03  platform: Windows NT

import sys

try:
    import Tkinter as tk
except ImportError:
    import tkinter as tk

try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True

class Toplevel1:
    def __init__(self):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9' # X11 color: 'gray85'
        _ana1color = '#d9d9d9' # X11 color: 'gray85'
        _ana2color = '#ececec' # Closest X11 color: 'gray92'
        font10 = "-family {SimSun} -size 20"
        font14 = "-family {SimSun} -size 24"
        font15 = "-family {SimSun} -size 12"

        self.top = tk.Tk()
        self.top.geometry("398x430+-1198+150")
        self.top.minsize(120, 1)
        self.top.maxsize(3844, 1063)
        self.top.resizable(1, 1)
        self.top.title("Calculadora")
        self.top.configure(background="#72afa6")

        self.Frame1 = tk.Frame(self.top)
        self.Frame1.place(relx=0.075, rely=0.07, relheight=0.849, relwidth=0.842)

        self.Frame1.configure(relief='groove')
        self.Frame1.configure(borderwidth="2")
        self.Frame1.configure(relief="groove")
        self.Frame1.configure(background="#5a9e94")

        self.Entry1 = tk.Entry(self.Frame1)
        self.Entry1.place(relx=0.179, rely=0.137,height=40, relwidth=0.251)
        self.Entry1.configure(background="white")
        self.Entry1.configure(disabledforeground="#a3a3a3")
        self.Entry1.configure(font="TkFixedFont")
        self.Entry1.configure(foreground="#000000")
        self.Entry1.configure(insertbackground="black")

        self.Label1 = tk.Label(self.Frame1)
        self.Label1.place(relx=0.269, rely=0.027, height=21, width=164)
        self.Label1.configure(background="#5a9e94")
        self.Label1.configure(disabledforeground="#a3a3a3")
        self.Label1.configure(font=font10)
        self.Label1.configure(foreground="#ffffff")
        self.Label1.configure(text='''Calculadora''')

        self.Entry2 = tk.Entry(self.Frame1)
        self.Entry2.place(relx=0.567, rely=0.137,height=40, relwidth=0.251)
        self.Entry2.configure(background="white")
        self.Entry2.configure(disabledforeground="#a3a3a3")
        self.Entry2.configure(font="TkFixedFont")
        self.Entry2.configure(foreground="#000000")
        self.Entry2.configure(insertbackground="black")

        self.Label2 = tk.Label(self.Frame1)
        self.Label2.place(relx=0.388, rely=0.274, height=31, width=74)
        self.Label2.configure(background="#ffffff")
        self.Label2.configure(disabledforeground="#a3a3a3")
        self.Label2.configure(font=font15)
        self.Label2.configure(foreground="#000000")
        self.Label2.configure(text='''Resultado''')

        self.Button1 = tk.Button(self.Frame1, command=self.Somar)
        self.Button1.place(relx=0.418, rely=0.411, height=54, width=57)
        self.Button1.configure(activebackground="#ececec")
        self.Button1.configure(activeforeground="#000000")
        self.Button1.configure(background="#d9d9d9")
        self.Button1.configure(disabledforeground="#a3a3a3")
        self.Button1.configure(font=font14)
        self.Button1.configure(foreground="#000000")
        self.Button1.configure(highlightbackground="#d9d9d9")
        self.Button1.configure(highlightcolor="black")
        self.Button1.configure(pady="0")
        self.Button1.configure(text='''+''')

        self.Button3 = tk.Button(self.Frame1, command=self.Dividir)
        self.Button3.place(relx=0.418, rely=0.795, height=54, width=57)
        self.Button3.configure(activebackground="#ececec")
        self.Button3.configure(activeforeground="#000000")
        self.Button3.configure(background="#d9d9d9")
        self.Button3.configure(disabledforeground="#a3a3a3")
        self.Button3.configure(font=font14)
        self.Button3.configure(foreground="#000000")
        self.Button3.configure(highlightbackground="#d9d9d9")
        self.Button3.configure(highlightcolor="black")
        self.Button3.configure(pady="0")
        self.Button3.configure(text='''/''')

        self.Button4 = tk.Button(self.Frame1, command=self.Multiplicar)
        self.Button4.place(relx=0.627, rely=0.603, height=54, width=57)
        self.Button4.configure(activebackground="#ececec")
        self.Button4.configure(activeforeground="#000000")
        self.Button4.configure(background="#d9d9d9")
        self.Button4.configure(disabledforeground="#a3a3a3")
        self.Button4.configure(font=font14)
        self.Button4.configure(foreground="#000000")
        self.Button4.configure(highlightbackground="#d9d9d9")
        self.Button4.configure(highlightcolor="black")
        self.Button4.configure(pady="0")
        self.Button4.configure(text='''x''')

        self.Button5 = tk.Button(self.Frame1, command=self.Subtrair)
        self.Button5.place(relx=0.209, rely=0.603, height=54, width=57)
        self.Button5.configure(activebackground="#ececec")
        self.Button5.configure(activeforeground="#000000")
        self.Button5.configure(background="#d9d9d9")
        self.Button5.configure(disabledforeground="#a3a3a3")
        self.Button5.configure(font=font14)
        self.Button5.configure(foreground="#000000")
        self.Button5.configure(highlightbackground="#d9d9d9")
        self.Button5.configure(highlightcolor="black")
        self.Button5.configure(pady="0")
        self.Button5.configure(text='''-''')
        self.top.mainloop()

    def Somar(self):
        n1 = float(self.Entry1.get())
        n2 = float(self.Entry2.get())
        self.Label2 ['text'] = n1 + n2
    
    def Dividir(self):
        n1 = float(self.Entry1.get())
        n2 = float(self.Entry2.get())
        self.Label2['text'] = n1 / n2
    
    def Multiplicar(self):
        n1 = float(self.Entry1.get())
        n2 = float(self.Entry2.get())
        self.Label2['text'] = n1 * n2
    
    def Subtrair(self):
        n1 = float(self.Entry1.get())
        n2 = float(self.Entry2.get())
        self.Label2['text'] = n1 - n2

Toplevel1()






#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 5.4
#  in conjunction with Tcl version 8.6
#    Jul 26, 2020 10:00:47 PM -03  platform: Windows NT

import sys

try:
    import Tkinter as tk
except ImportError:
    import tkinter as tk

try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True

class Toplevel1:
    def __init__(self):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9' # X11 color: 'gray85'
        _ana1color = '#d9d9d9' # X11 color: 'gray85'
        _ana2color = '#ececec' # Closest X11 color: 'gray92'
        font10 = "-family {SimSun} -size 20"
        font14 = "-family {SimSun} -size 24"
        font15 = "-family {SimSun} -size 12"

        self.top = tk.Tk()
        self.top.geometry("398x430+-1198+150")
        self.top.minsize(120, 1)
        self.top.maxsize(3844, 1063)
        self.top.resizable(1, 1)
        self.top.title("Calculadora")
        self.top.configure(background="#72afa6")

        self.Frame1 = tk.Frame(self.top)
        self.Frame1.place(relx=0.075, rely=0.07, relheight=0.849, relwidth=0.842)

        self.Frame1.configure(relief='groove')
        self.Frame1.configure(borderwidth="2")
        self.Frame1.configure(relief="groove")
        self.Frame1.configure(background="#5a9e94")

        self.Entry1 = tk.Entry(self.Frame1)
        self.Entry1.place(relx=0.179, rely=0.137,height=40, relwidth=0.251)
        self.Entry1.configure(background="white")
        self.Entry1.configure(disabledforeground="#a3a3a3")
        self.Entry1.configure(font="TkFixedFont")
        self.Entry1.configure(foreground="#000000")
        self.Entry1.configure(insertbackground="black")

        self.Label1 = tk.Label(self.Frame1)
        self.Label1.place(relx=0.269, rely=0.027, height=21, width=164)
        self.Label1.configure(background="#5a9e94")
        self.Label1.configure(disabledforeground="#a3a3a3")
        self.Label1.configure(font=font10)
        self.Label1.configure(foreground="#ffffff")
        self.Label1.configure(text='''Calculadora''')

        self.Entry2 = tk.Entry(self.Frame1)
        self.Entry2.place(relx=0.567, rely=0.137,height=40, relwidth=0.251)
        self.Entry2.configure(background="white")
        self.Entry2.configure(disabledforeground="#a3a3a3")
        self.Entry2.configure(font="TkFixedFont")
        self.Entry2.configure(foreground="#000000")
        self.Entry2.configure(insertbackground="black")

        self.Label2 = tk.Label(self.Frame1)
        self.Label2.place(relx=0.388, rely=0.274, height=31, width=74)
        self.Label2.configure(background="#ffffff")
        self.Label2.configure(disabledforeground="#a3a3a3")
        self.Label2.configure(font=font15)
        self.Label2.configure(foreground="#000000")
        self.Label2.configure(text='''Resultado''')

        self.Button1 = tk.Button(self.Frame1, command=self.Somar)
        self.Button1.place(relx=0.418, rely=0.411, height=54, width=57)
        self.Button1.configure(activebackground="#ececec")
        self.Button1.configure(activeforeground="#000000")
        self.Button1.configure(background="#d9d9d9")
        self.Button1.configure(disabledforeground="#a3a3a3")
        self.Button1.configure(font=font14)
        self.Button1.configure(foreground="#000000")
        self.Button1.configure(highlightbackground="#d9d9d9")
        self.Button1.configure(highlightcolor="black")
        self.Button1.configure(pady="0")
        self.Button1.configure(text='''+''')

        self.Button3 = tk.Button(self.Frame1, command=self.Dividir)
        self.Button3.place(relx=0.418, rely=0.795, height=54, width=57)
        self.Button3.configure(activebackground="#ececec")
        self.Button3.configure(activeforeground="#000000")
        self.Button3.configure(background="#d9d9d9")
        self.Button3.configure(disabledforeground="#a3a3a3")
        self.Button3.configure(font=font14)
        self.Button3.configure(foreground="#000000")
        self.Button3.configure(highlightbackground="#d9d9d9")
        self.Button3.configure(highlightcolor="black")
        self.Button3.configure(pady="0")
        self.Button3.configure(text='''/''')

        self.Button4 = tk.Button(self.Frame1, command=self.Multiplicar)
        self.Button4.place(relx=0.627, rely=0.603, height=54, width=57)
        self.Button4.configure(activebackground="#ececec")
        self.Button4.configure(activeforeground="#000000")
        self.Button4.configure(background="#d9d9d9")
        self.Button4.configure(disabledforeground="#a3a3a3")
        self.Button4.configure(font=font14)
        self.Button4.configure(foreground="#000000")
        self.Button4.configure(highlightbackground="#d9d9d9")
        self.Button4.configure(highlightcolor="black")
        self.Button4.configure(pady="0")
        self.Button4.configure(text='''x''')

        self.Button5 = tk.Button(self.Frame1, command=self.Subtrair)
        self.Button5.place(relx=0.209, rely=0.603, height=54, width=57)
        self.Button5.configure(activebackground="#ececec")
        self.Button5.configure(activeforeground="#000000")
        self.Button5.configure(background="#d9d9d9")
        self.Button5.configure(disabledforeground="#a3a3a3")
        self.Button5.configure(font=font14)
        self.Button5.configure(foreground="#000000")
        self.Button5.configure(highlightbackground="#d9d9d9")
        self.Button5.configure(highlightcolor="black")
        self.Button5.configure(pady="0")
        self.Button5.configure(text='''-''')
        self.top.mainloop()

    def Somar(self):
        n1 = float(self.Entry1.get())
        n2 = float(self.Entry2.get())
        self.Label2 ['text'] = n1 + n2
    
    def Dividir(self):
        n1 = float(self.Entry1.get())
        n2 = float(self.Entry2.get())
        self.Label2['text'] = n1 / n2
    
    def Multiplicar(self):
        n1 = float(self.Entry1.get())
        n2 = float(self.Entry2.get())
        self.Label2['text'] = n1 * n2
    
    def Subtrair(self):
        n1 = float(self.Entry1.get())
        n2 = float(self.Entry2.get())
        self.Label2['text'] = n1 - n2

Toplevel1()
#! /usr/bin/env python #  -*- coding: utf-8 -*- # # GUI module generated by PAGE version 5.4 #  in conjunction with Tcl version 8.6 #    Jul 26, 2020 10:00:47 PM -03  platform: Windows NT This class configures and populates the toplevel window.            top is the toplevel containing window. # X11 color: 'gray85' # X11 color: 'black' # X11 color: 'gray85' # X11 color: 'gray85' # Closest X11 color: 'gray92' Calculadora Resultado + / x -