navigate.view.main_application_window.MainApp
- class navigate.view.main_application_window.MainApp(root: Tk, *args: Iterable, **kwargs: Dict[str, Any])
Bases:
FrameCreates the frame that will hold the GUI content, its parent is the main window or root Tk object
A main window is created and passed to the mainapp class. This class will init as a frame then config the main window. It then creates a menubar using the menubar class.
Adds the options for each file menu. It then sets up the frames, then grids the frames.
Finally, it uses the notebook classes to put them into the respective frames on the tk.Grid. Each of the notebook classes includes tab classes and inits those etc.
The second parameter in each class __init__ function is the parent.
I used the name of the parent so that it would be easier to keep track of inheritances.
Once you have the parent name you can look to the parents class in the class definition.
For example for class Main_App(ttk.Frame) the parent to Main_App is a frame and its name is root. I also used the name of the class instead of self to make things easier to read. So for Main_App self is now mainapp.
Placing the notebooks using tk.Grid. While the grid is called on each frame it is actually calling the main window since those are the parent to the frames. The labels have already been packed into each respective frame so can be ignored in the grid setup. This layout uses a 2x2 grid to start.
1 2 3 4 5 6
The above is the grid “spots” the left frame will take spots 3 & 5 while top right takes spot 4 and bottom right frame takes spot 6. Top frame will be spots 1 & 2
- __init__(root: Tk, *args: Iterable, **kwargs: Dict[str, Any]) → None
Initiates the main application window
- Parameters:
root (tk.Tk) – The main window of the application
*args (iterable) – Variable length argument list
**kwargs (dict) – Arbitrary keyword arguments
Methods
__init__(root, *args, **kwargs)Initiates the main application window
Attributes
- acquire_bar
The acquire bar for the application
- Type:
- camera_waveform
The camera notebook for the application
- Type:
- left_frame
The left frame of the application
- Type:
ttk.Frame
- logger
The logger for this class
- Type:
logging.Logger
- right_frame
The top right frame of the application
- Type:
ttk.Frame
- root
The main window of the application
- Type:
tk.Tk
- scroll_frame
The scrollable version of the main frame for the application
- Type:
- settings
The settings notebook for the application
- Type:
- top_frame
The top frame of the application
- Type:
ttk.Frame