Part of a larger program I am building a module which is going to be called by a seperate (master) module, or added to the master code as a function.
I am using Tkinter to build the GUI and using bootstrap (as “tb” in my code so it isnt confused with any Tk, or Ttk). Bootstrap allows the use of togglebuttons which I have used in the new module/function. The GUI for the new (“bbb” module works perfectly when called directly from the terminal. All formatting is as expected (see photo 1)
Photo 1 - Explected Outcome
When called via function from within my master code, or as a module I get the out put shown in photo 2. I also get this error code:
Exception in Tkinter callback
Traceback (most recent call last):

File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/init.py”, line 1967, in call
return self.func(*args)
^^^^^^^^^^^^^^^^
File “/Users/dwheatley/modules/ecg_rebuild.py”, line 578, in bbb_assess
qrs_criteria = tb.Checkbutton(rbbb_fr, text = ‘QRS duration > 120ms’, style = ‘Roundtoggle.ToolButton’)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/ttkbootstrap/style.py”, line 4953, in init
self.configure(style=ttkstyle)
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/ttkbootstrap/style.py”, line 5003, in configure
func(self, cnf, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/init.py”, line 1721, in configure
return self._configure(‘configure’, cnf, kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/init.py”, line 1711, in _configure
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: Layout Round.Toggle not found
Photo 2 - outcome I am getting.

complete code for module/function (as written to be run in a modue on its own)

from tkinter import *
from PIL import ImageTk, Image
import sqlite3
from tkinter import messagebox
from tkinter import scrolledtext
from tkinter import font
import os
from datetime import datetime as dt
import pdfkit
from tkinter import simpledialog
import jinja2
from ttkbootstrap.constants import *
import ttkbootstrap as tb



bbb = tb.Window(themename="solar")
#ecg = Tk()
bbb.geometry('860x640')
bbb.title('Bundle Branch Block Assessment')

style = tb.Style()
style.theme_use("solar")

def bbb_save_click():
    pass
def bbb_close_click():
    pass
#BBB
style.configure('solar.Tframe',
    font=('helvetica', 18), 
    bootstyle='info')

style.configure('solar.info.TLabel',
    foreground = 'white',
    font=('helvetica', 18), 
    bootstyle='info')

style.configure('small.info.TLabel',
    foreground = 'white',
    font=('helvetica', 14), 
    bootstyle='info')
#Image Resizing
with Image.open("/Users/dwheatley/modules/images/Right-Bundle-Branch-Block-RBBB-ECG-Strip-LITFL.png") as im:

    # Provide the target width and height of the image
    (width, height) = (im.width // 4, im.height // 4)
    im_resized = im.resize((width, height))

rbbb_im = ImageTk.PhotoImage(im_resized)

with Image.open("/Users/dwheatley/modules/images/Left-Bundle-Branch-Block-LBBB-ECG-Strip-LITFL.png") as im:

    # Provide the target width and height of the image
    (width, height) = (im.width // 4, im.height // 4)
    im_resized = im.resize((width, height))

lbbb_im = ImageTk.PhotoImage(im_resized)

#RBBB
rbbb_fr = tb.LabelFrame(bbb, width = 400, height=300, style = 'solar.TFrame')
rbbb_fr.place(x=0, y=0)
rbbb_heading_lbl = tb.Label(rbbb_fr, text = "Right Bundle Branch Block", width=400,
    font=('Courier New',22),
    style = 'info.TLabel')
rbbb_heading_lbl.place(x=10, y=0)
qrs_bbb_lbl = tb.Label(rbbb_fr, text = "Diagnotic Criteria for RBBB:",
    style = 'small.info.TLabel')
qrs_bbb_lbl.place(x=10, y=45)

qrs_criteria = tb.Checkbutton(rbbb_fr, text = 'QRS duration > 120ms', style = 'Roundtoggle.ToolButton')
qrs_criteria.place(x=45, y= 85)

rsr_criteria = tb.Checkbutton(rbbb_fr, text = 'RSR Pattern in V1-3 ("M Shaped" QRS Complex)', style = 'Roundtoggle.ToolButton')
rsr_criteria.place(x=45, y= 125)

qrs_criteria = tb.Checkbutton(rbbb_fr, text = 'Wide, Slurred S wave in lateral leads (I, aVL, V5-6)', style = 'Roundtoggle.ToolButton')
qrs_criteria.place(x=45, y= 165)

rbbb_image_frame = LabelFrame(bbb)
rbbb_image_frame.place(x=400, y=5)
rbbb_im_lbl = tb.Label(rbbb_image_frame, image=rbbb_im, width=600)
rbbb_im_lbl.grid(row=0, column=0)
#LBBB
lbbb_fr = tb.LabelFrame(bbb, width = 400, height=300, style = 'solar.TFrame')
lbbb_fr.place(x=0, y=300)
lbbb_heading_lbl = tb.Label(lbbb_fr, text = "Left Bundle Branch Block", width=400,
    font=('Courier New',22),
    style = 'info.TLabel')
lbbb_heading_lbl.place(x=10, y=0)
qrs_lbbb_lbl = tb.Label(lbbb_fr, text = "Diagnotic Criteria for LBBB:",
    style = 'small.info.TLabel')
qrs_lbbb_lbl.place(x=10, y=45)

qrs_criteria_l = tb.Checkbutton(lbbb_fr, text = 'QRS duration > 120ms', style = 'Roundtoggle.toolbutton')
qrs_criteria_l.place(x=45, y= 85)

s_wave = tb.Checkbutton(lbbb_fr, text = 'Dominant S wave in V1', style = 'roundtoggle.toolbutton')
s_wave.place(x=45, y= 125)

monophasic_r = tb.Checkbutton(lbbb_fr, text = 'Broad monophasic R wave in lateral leads n(I, aVL, V5-6)', style = 'roundtoggle.toolbutton')
monophasic_r.place(x=45, y= 165)

q_wave = tb.Checkbutton(lbbb_fr, text = 'Absence of Q waves in lateral leads', style = 'roundtoggle.toolbutton')
q_wave.place(x=45, y= 205)

r_w_peak = tb.Checkbutton(lbbb_fr, text = 'Prolonged R wave peak time > 60ms in leads V5-6', style = 'roundtoggle.toolbutton')
r_w_peak.place(x=45, y= 245)

lbbb_image_frame = LabelFrame(bbb)
lbbb_image_frame.place(x=400, y=305)
lbbb_im_lbl = tb.Label(lbbb_image_frame, image=lbbb_im, width=600)
lbbb_im_lbl.grid(row=0, column=0)

#Buttons
save_close_bbb = tb.Button(bbb,text="Save and Close",
    width=40,
    command = bbb_save_click)
save_close_bbb.place(x=25,y=605)

close_bbb = tb.Button(bbb,text="Cancel/Close",
    width=40,
    command = bbb_close_click)
close_bbb.place(x=420,y=605)



mainloop()

I have tried calling in different ways, adjusting style function’s and formatting within the object. I am sure itis a problem with bootstrap and something I am missing when formatting.

1