Utilities API
ThreePaneWindows - Professional three-pane window layouts for Tkinter applications.
This package provides sophisticated three-pane window layouts with advanced features: - Fixed and dockable layouts - Professional theming system - Cross-platform icon support (.ico, .png, .gif, .bmp, .xbm) - Drag-and-drop pane management - Resizable panes with constraints - Status bars, toolbars, and context menus - Cross-platform compatibility
- Main Components:
FixedThreePaneWindow: Simple fixed three-pane layout
DockableThreePaneWindow: Advanced layout with docking capabilities
EnhancedDockableThreePaneWindow: Full-featured layout with all bells and whistles
ThemeManager: Professional theming system
- Quick Start:
>>> import tkinter as tk >>> from threepanewindows import FixedThreePaneWindow >>> >>> root = tk.Tk() >>> window = FixedThreePaneWindow(root) >>> window.pack(fill=tk.BOTH, expand=True) >>> >>> # Add content to panes >>> tk.Label(window.left_pane, text="Left").pack() >>> tk.Label(window.center_pane, text="Center").pack() >>> tk.Label(window.right_pane, text="Right").pack()
- class threepanewindows.FixedThreePaneLayout(master, side_width=150, sash_width=2, left_width=None, right_width=None, left_fixed_width=None, right_fixed_width=None, min_pane_size=50, menu_bar=None, **kwargs)[source]
Bases:
FrameA fixed three-pane window layout with left, center, and right panes.
This class provides a simple three-pane layout where the side panes can have fixed or resizable widths, and the center pane fills the remaining space. It supports menu bars and customizable pane sizing.
- Parameters:
master (tk.Widget) – The parent widget.
side_width (int) – Default width for side panes (default: 150).
sash_width (int) – Width of the sash/separator between panes (default: 2).
left_width (Optional[int]) – Specific width for left pane (overrides side_width).
right_width (Optional[int]) – Specific width for right pane (overrides side_width).
left_fixed_width (Optional[int]) – Fixed width for left pane (non-resizable).
right_fixed_width (Optional[int]) – Fixed width for right pane (non-resizable).
min_pane_size (int) – Minimum size for resizable panes (default: 50).
menu_bar (Optional[tk.Menu]) – Menu bar to attach to the parent window.
**kwargs – Additional keyword arguments passed to tk.Frame.
Construct a frame widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, class, colormap, container, cursor, height, highlightbackground, highlightcolor, highlightthickness, relief, takefocus, visual, width.
- property center_pane: Frame
Access to center pane for adding widgets.
- clear_center()[source]
Clear all widgets from the center pane except the default label.
- Return type:
None
- clear_left()[source]
Clear all widgets from the left pane except the default label.
- Return type:
None
- clear_right()[source]
Clear all widgets from the right pane except the default label.
- Return type:
None
- property frame_center: Frame
Get the center frame container (legacy property name).
- property frame_left: Frame
Get the left frame container (legacy property name).
- property frame_right: Frame
Get the right frame container (legacy property name).
- property left_pane: Frame
Access to left pane for adding widgets.
- property right_pane: Frame
Access to right pane for adding widgets.
- class threepanewindows.ThemeType(value)[source]
Bases:
EnumEnumeration of available theme types.
- BLUE = 'blue'
- CUSTOM = 'custom'
- DARK = 'dark'
- GREEN = 'green'
- LIGHT = 'light'
- NATIVE = 'native'
- NATIVE_DARK = 'native_dark'
- NATIVE_LIGHT = 'native_light'
- PURPLE = 'purple'
- SYSTEM = 'system'
- threepanewindows.enable_console_logging(level=20)[source]
Enable console logging for the entire library.
- Parameters:
level (int) – Minimum logging level to display
- Return type:
None
- threepanewindows.get_recommended_icon_formats()[source]
Get recommended icon formats for the current platform.
- Returns:
- List of file extensions in order of preference for the
current platform. For example, Windows returns [‘.ico’, ‘.png’], while Linux/macOS return [‘.png’, ‘.ico’].
- Return type:
List[str]
- threepanewindows.set_global_theme(theme, custom_scheme=None, window=None)[source]
Set the global theme for all ThreePaneWindows components.
- Parameters:
custom_scheme (ColorScheme | None)
window (Tk | None)
- Return type:
- threepanewindows.validate_icon_path(icon_path)[source]
Validate an icon path for cross-platform compatibility.
Utility Functions
This module contains various utility functions and constants used throughout the library.
Icon Utilities
Cross-platform icon support utilities for enhanced window functionality.
- threepanewindows.get_recommended_icon_formats()[source]
Get recommended icon formats for the current platform.
- Returns:
- List of file extensions in order of preference for the
current platform. For example, Windows returns [‘.ico’, ‘.png’], while Linux/macOS return [‘.png’, ‘.ico’].
- Return type:
List[str]
- threepanewindows.validate_icon_path(icon_path)[source]
Validate an icon path for cross-platform compatibility.
Version Information
- threepanewindows.__version__ = '1.2.0'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
- threepanewindows.__author__ = 'Stan Griffiths'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.
- threepanewindows.__email__ = 'stantgriffiths@gmail.com'
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.