I did a version of your code. You can look at the way I did the styling and maybe it will help.
#! /usr/bin/env python3 import tkinter as tk from tkinter import ttk from ttkbootstrap import Style import sys class Window: def __init__(self, parent): self.parent = parent self.parent.rowconfigure(0, weight=1) self.parent.columnconfigure(0, weight=1) # Create some styles exit_btn = Style() exit_btn.map('danger.TButton', background = [ ('disabled', 'tomato'), ('active', 'red')]) exit_btn.configure('danger.TButton', font=('verdana', 12, 'bold')) nb = ttk.Style() cur_nb_theme = nb.theme_use() nb.theme_settings(cur_nb_theme, {'TNotebook.Tab': {'configure': {'font': ('comic sans ms', 12, 'bold'), 'foreground': 'blue', 'background': 'lightblue'} }}) # Container frame to hold everything container = tk.Frame(self.parent) container.grid(column=0, row=0, sticky='news') container.grid_columnconfigure(0, weight=3) # Configure the header label = tk.Label(container) label['text'] = 'DGRF Frequency Synthesizer 45 MHz - 22 GHz' label['font'] = ('comic sans ms', 18, 'bold') label['foreground'] = 'steel blue' label['relief'] = 'groove' label['pady'] = 3 label.grid(column=0, row=0, sticky='new') # Create the notebook notebook = ttk.Notebook(container) notebook.grid(column=0, row=1, sticky='new') # Create and add the tabs tab1 = ttk.Frame(notebook) tab1.grid(column=0, row=0, sticky='new') tab2 = ttk.Frame(notebook) tab2.grid(column=1, row=0, sticky='new') notebook.add(tab1, text='Reference Chain') notebook.add(tab2, text='CW Output') # Create a container frame for the two info frames and button btm_container = tk.Frame(container) btm_container.grid(column=0, row=2, sticky='new', pady=3) btm_container.grid_columnconfigure(0, weight=1) btm_container.grid_columnconfigure(1, weight=3) btm_container.grid_columnconfigure(2, weight=1) # for i in range(3): # btm_container.grid_columnconfigure(i, weight=3, uniform='btm') # Create error message label error_label = ttk.Label(btm_container, anchor='w', background='lightblue') error_label['text'] = 'Error Messages:' error_label['padding'] = [10, 0, 0, 0] error_label['font'] = ('tahoma', 10, 'bold') error_label['foreground'] = 'navy' error_label.grid(column=0, row=0, sticky='news') # Create message label message = ttk.Label(btm_container, anchor='w', background='lightblue') message['text'] = 'Please Initialize' message['font'] = ('tahoma', 10, 'italic bold') message.grid(column=1, row=0, sticky='news') btn = ttk.Button(btm_container, text='Exit', cursor='hand2') btn['command'] = self.exit btn['style'] = 'danger.TButton' btn.grid(column=2, row=0, sticky='new', padx=2) # Create some data for the tabs for i in range(20): label = tk.Label(tab1, text=f'Line {i} text for tab1') label.grid(column=0, row=i, sticky='news') for i in range(20): label = tk.Label(tab2, text=f'Line {i} text for tab2') label.grid(column=0, row=i, sticky='news') # Create the method/function for the exit button def exit(self): sys.exit() def main(): root = tk.Tk() # root.geometry('800x600+250+250') # root.resizable(0, 0) root['padx'] = 5 root['pady'] = 3 root.title('Part Number: DGRF2820 Rev1 Software ver 1.0') Window(root) root.mainloop() if __name__ == '__main__': main()[attachment=1291]
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags