Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tkinter Class
#2
A class is a container for a bunch of related functions, which once they become part of the class are now referred to as methods.
the __init__ method is used to initialize any inherited classes, define variables that are used throught the class, and any other objects that need to be initialized.

This class inherits tkinter.Frame, so initializes that class, and makes master visible to all methods and then executes the initialize_user_interface method which sets up the widgets being use by the application.

Once the class has been created, new instances of the class can be created simply by using simple syntax x = MyClass()

You really ought to read up on classes as they are a bit complex

here are a couple of links:
https://www.w3schools.com/python/python_classes.asp
and the python doc:
https://docs.python.org/3/tutorial/classes.html
Reply


Messages In This Thread
Tkinter Class - by pythonenthusiast2 - Nov-24-2019, 02:28 AM
RE: Tkinter Class - by Larz60+ - Nov-24-2019, 03:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb Using Tkinter With Concurrent.Futures / ThreadPoolExecutor Class AaronCatolico1 1 1,467 Dec-14-2022, 08:01 PM
Last Post: deanhystad
Lightbulb [Tkinter] Tkinter Class Import Module Issue AaronCatolico1 6 3,096 Sep-06-2022, 03:37 PM
Last Post: AaronCatolico1
  [Tkinter] Redirecting all print statements from all functions inside a class to Tkinter Anan 1 2,639 Apr-24-2021, 08:57 AM
Last Post: ndc85430
  tkinter moving an class object with keybinds gr3yali3n 5 3,269 Feb-10-2021, 09:13 PM
Last Post: deanhystad
  [Tkinter] Troubles with accessing attr from other class zarize 3 2,624 Aug-20-2020, 06:05 PM
Last Post: deanhystad
  [Tkinter] Use function from other class (Tkinter) zarize 8 4,774 Aug-17-2020, 09:47 AM
Last Post: zarize
  Unable fetch fucntion data in class in tkinter jenkins43 2 3,871 Nov-30-2019, 09:47 PM
Last Post: jenkins43
  Tkinter Gui ScrolledText Insert From Different Class whisperquiet 1 4,321 Jan-08-2019, 09:25 PM
Last Post: Larz60+
  Using a class to create instances of Tkinter Toplevel() windows nortski 2 10,971 Mar-27-2018, 11:44 AM
Last Post: nortski

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020