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: Frame

A 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.

add_to_center(widget)[source]
Parameters:

widget (Widget)

Return type:

None

add_to_left(widget)[source]
Parameters:

widget (Widget)

Return type:

None

add_to_right(widget)[source]
Parameters:

widget (Widget)

Return type:

None

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).

get_left_width()[source]

Get the current left pane width.

Return type:

int

get_right_width()[source]

Get the current right pane width.

Return type:

int

is_left_fixed()[source]

Check if left pane has fixed width.

Return type:

bool

is_right_fixed()[source]

Check if right pane has fixed width.

Return type:

bool

property left_pane: Frame

Access to left pane for adding widgets.

property right_pane: Frame

Access to right pane for adding widgets.

set_label_texts(left=None, center=None, right=None)[source]
Parameters:
  • left (str | None)

  • center (str | None)

  • right (str | None)

Return type:

None

set_left_width(width)[source]

Set the left pane width.

Parameters:

width (int)

Return type:

None

set_right_width(width)[source]

Set the right pane width.

Parameters:

width (int)

Return type:

None

class threepanewindows.ThemeType(value)[source]

Bases: Enum

Enumeration 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.add_file_logging(filepath, level=10)[source]

Add file logging for the library.

Parameters:
  • filepath (str) – Path to log file

  • level (int) – Minimum logging level for file output

Return type:

None

threepanewindows.disable_logging()[source]

Disable all logging for the library.

Return type:

None

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

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.get_theme_manager()[source]

Get the global theme manager instance.

Return type:

ThemeManager

threepanewindows.set_global_theme(theme, custom_scheme=None, window=None)[source]

Set the global theme for all ThreePaneWindows components.

Parameters:
Return type:

bool

threepanewindows.validate_icon_path(icon_path)[source]

Validate an icon path for cross-platform compatibility.

Parameters:

icon_path (str) – Path to the icon file to validate.

Returns:

A tuple containing:
  • bool: True if the icon path is valid and supported, False otherwise

  • str: Descriptive message about the validation result

Return type:

Tuple[bool, str]

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.

Parameters:

icon_path (str) – Path to the icon file to validate.

Returns:

A tuple containing:
  • bool: True if the icon path is valid and supported, False otherwise

  • str: Descriptive message about the validation result

Return type:

Tuple[bool, str]

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’.