From 220d312b6ed37ca3d6d97245c8cd868a3c8d67d8 Mon Sep 17 00:00:00 2001 From: shivamsatyam <69047012+shivamsatyam@users.noreply.github.com> Date: Mon, 11 Oct 2021 00:31:44 +0530 Subject: [PATCH 1/2] Update buttons.py --- buttons.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/buttons.py b/buttons.py index 9e7cd30..908959d 100644 --- a/buttons.py +++ b/buttons.py @@ -1,15 +1,19 @@ from tkinter import * -root = Tk() -def myClick(): - myLabel = Label(root, text="Look! I clicked a Button!!") - myLabel.pack() - -myButton = Button(root, text="Click Me!", command=myClick) -myButton.pack() - - - -root.mainloop() +class Button(TK): + super().__init__() + self.geometry("800x400") + + def myClick(): + self.myLabel = Label(self, text="Look! I clicked a Button!!") + self.myLabel.pack() + def create_button(): + self.btn = Button(self, text="Click Me!", command=myClick) + def run(): + self.mainloop() + +b = Button() +b.create_button() +b.run() From 57f4af5f428f885702e4f0ec5224f7f3a76076a6 Mon Sep 17 00:00:00 2001 From: shivamsatyam <69047012+shivamsatyam@users.noreply.github.com> Date: Mon, 11 Oct 2021 00:32:37 +0530 Subject: [PATCH 2/2] Update center.py --- center.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/center.py b/center.py index 2d1ba42..0c26433 100644 --- a/center.py +++ b/center.py @@ -3,6 +3,7 @@ root = Tk() root.title('Codemy.com - Center') root.iconbitmap('c:/gui/codemy.ico') +root.geometry("800x500") # Designate Height and Width of our app app_width = 500 @@ -20,4 +21,4 @@ my_label = Label(root, text=f'Width:{screen_width} Height:{screen_height}') my_label.pack(pady=20) -root.mainloop() \ No newline at end of file +root.mainloop()