From 86e0ac74bae949a08574fa79ec09e8764bc3deae Mon Sep 17 00:00:00 2001 From: sharklab7 <55528399+sharklab7@users.noreply.github.com> Date: Thu, 1 Oct 2020 12:05:41 +0530 Subject: [PATCH] Update Calculator with GUI.py 1. Setting a default Window Size for Output window 2. Fixing the layout. Users will not be able to increase or decreasing window size. So our window will look good in all cases. --- Calculator with GUI.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Calculator with GUI.py b/Calculator with GUI.py index 0aec793..82175bc 100644 --- a/Calculator with GUI.py +++ b/Calculator with GUI.py @@ -8,7 +8,7 @@ import math -class Calc(): +class Calc: def __init__(self): self.total = 0 self.current = "" @@ -104,16 +104,25 @@ def sign(self): self.current = -(float(text_box.get())) self.display(self.current) + sum1 = Calc() root = Tk() calc = Frame(root) calc.grid() root.title("Calculator") + +# Setting Default Window Size +root.geometry("382x400") + +# Fixing the layout. +root.maxsize(382,395) +root.minsize(382,395) + text_box = Entry(calc, justify=RIGHT,width=30,font="Times 16 bold") text_box.grid(row = 0, column = 0,columnspan = 8,padx=30, pady = 30) text_box.insert(0, "0") -#text_box.focus() +# text_box.focus() numbers = "789456123" i = 0