This checklist prevents common integration mistakes and ensures successful Bravura implementation.
__init__ method signaturesTheme Manager:
# CORRECT ✅
class AppWrapper:
def __init__(self, root):
self.root = root
app = AppWrapper(tk.Tk())
theme_manager = ProfessionalThemeManager(app)
Ambient Background:
# CORRECT ✅
AmbientBackground(
parent_widget,
width=int,
height=int,
enable_animation=bool,
animation_speed="slow"/"medium"/"fast",
particle_count=int,
glow_effects=bool
)
# WRONG ❌ - These parameters don't exist:
# primary_color, secondary_color, tertiary_color, glow_intensity
Critical: Regular tk.Button Does NOT Respond to ttk.Style!
Wrong Approach ❌:
# This creates ILLEGIBLE gray buttons with white text!
button = ttk.Button(parent, text="Click Me")
# Theme applies but colors are wrong
Correct Approach ✅:
# Option 1: Use themed ttk.Button with proper configuration
style = ttk.Style()
style.configure('Custom.TButton',
background='#20C6B7',
foreground='#FFFFFF',
borderwidth=0,
focuscolor='none')
button = ttk.Button(parent, text="Click Me", style='Custom.TButton')
# Option 2: Use Bravura PremiumButton (requires import)
from bravura.components.premium_buttons import PremiumButton
button = PremiumButton(parent, text="Click Me", style="primary")
# Option 3: Manual tk.Button styling (less reliable)
button = tk.Button(parent,
text="Click Me",
bg='#20C6B7',
fg='#FFFFFF',
activebackground='#1AB5A6',
activeforeground='#FFFFFF',
relief='flat',
borderwidth=0)
Problem: Writing code based on what you think the API should be
Solution: Always read the actual source code first
Problem: bg parameter doesn't work on Windows/Mac for ttk.Button
Solution: Use ttk.Style or custom tk.Button with explicit colors
Problem: Calling canvas.lower() without arguments fails
Solution: Use canvas.tkraise() on foreground widgets instead
Problem: Windows file logging uses cp1252, can't handle emojis
Solution: Always specify encoding='utf-8' in FileHandler
Problem: Passing tk.Tk() directly instead of wrapper object
Solution: Create wrapper class with .root attribute
Before declaring integration complete, run this test:
#!/usr/bin/env python3
"""
Minimal Bravura Integration Test
Run this BEFORE integrating into your app!
"""
import tkinter as tk
from tkinter import ttk
# Test 1: Theme Manager
try:
from bravura.themes.theme_manager import ProfessionalThemeManager
root = tk.Tk()
root.title("Bravura Integration Test")
root.geometry("600x400")
class AppWrapper:
def __init__(self, root):
self.root = root
app = AppWrapper(root)
theme = ProfessionalThemeManager(app)
theme.apply_theme("wigley_site")
print("✅ Theme Manager: SUCCESS")
except Exception as e:
print(f"❌ Theme Manager: FAILED - {e}")
exit(1)
# Test 2: Create Visible Button
frame = ttk.Frame(root)
frame.pack(fill="both", expand=True, padx=20, pady=20)
# Create button with explicit visibility
button = tk.Button(
frame,
text="Test Button - Can You Read This?",
bg='#20C6B7',
fg='#FFFFFF',
font=('Segoe UI', 12, 'bold'),
padx=20,
pady=10
)
button.pack(pady=20)
label = ttk.Label(
frame,
text="If this text and button are readable, theme is working!",
font=('Segoe UI', 11)
)
label.pack(pady=10)
print("✅ Visual Test: Launch window and verify text is readable")
print(" - Can you read the button text?")
print(" - Can you read the label text?")
print(" - Is button background teal (#20C6B7)?")
root.mainloop()
Before using any Bravura component:
.py fileIntegration is complete when:
Stop and fix if you see:
---
Attempt 1: Passive Integration
# Added Bravura methods but didn't use them properly
class MyApp:
def __init__(self):
# ❌ Forgot to call theme application
pass
def create_gui(self):
# Created widgets first
self.notebook = ttk.Notebook(...)
# ❌ Added ambient background LAST (hidden behind widgets)
self._create_ambient_background()
Result: 5988 lines, looked identical to original ❌
Mistakes Made:
Attempt 2: Systematic Replacement
# 1. Systematically replaced ALL 74 button instances
OLD: ttk.Button(parent, text="Click", command=cmd)
NEW: self.create_styled_button(parent, "Click", cmd)
# 2. Applied theme immediately in __init__
def __init__(self, root):
self.root = root
self._apply_bravura_dark_theme() # FIRST!
# 3. Created ambient background BEFORE widgets
def create_gui(self):
self._create_ambient_background() # FIRST!
self.root.update_idletasks()
self.notebook = ttk.Notebook(...) # Then widgets on top
Result: 6222 lines, marketing-ready POC ✅
Success Criteria Met:
Every mistake made was explicitly warned against in this checklist:
The Integration Checklist works! Following it prevents these mistakes.
---
Remember: If you can't read the text, your users can't either!
Test visually BEFORE declaring success!
---
Copyright © 2025 Wigley Studios LLC