Repository navigation
V0.28 - NumpyGUI, modern & dual-pane ๐ป
Patch Notes: NumpyGui Update
๐ Top-Level Summary
This update transforms NumpyGui from a menu-driven, single-window application into a modern, dual-pane interface with persistent state management. It introduces a tabbed operations panel, inline controls for complex functions, and significantly refactors the codebase for maintainability and stability.
๐ New Features
๐พ Persistent State Management
- New
StateManagerClass: Implemented to handle saving and loading settings vianumpygui_state.json. - Persisted Settings:
- Theme: Remembers "Light" vs "Dark" mode preference across restarts.
- View Configuration: Remembers the visibility state of the Operations Tabs and Menu Bar.
๐๏ธ Tabbed Operations Interface
- Side Panel: Added a
CTkTabviewon the right side of the window, organizing operations into 10 distinct categories (Arithmetic, Rounding, Trig, Stats, etc.). - Dynamic Resizing:
- Compact Mode: Width
725px(Tabs hidden). - Expanded Mode: Width
1050px(Tabs visible).
- Compact Mode: Width
- View Control: Added a View menu to toggle the Side Tabs and Top Menus independently.
๐งฎ Calculator Grid (Arithmetic Tab)
- Visual Update: Replaced the list of text-based arithmetic commands with a Calculator-style Grid.
- Symbols: Uses mathematical symbols (
+,-,ร,รท,xยฒ,โ,|x|) for faster recognition.
๐ ๏ธ Functional Overhaul: Inline Controls
Many operations that previously required popup windows (CTkToplevel) or lacked parameter inputs have been upgraded to use Inline Controls directly within the tabs.
| Feature | Old Behavior | New Behavior |
|---|---|---|
| Data Filtering | Opened a popup window for "Size" and "Parity". |
Inline: CTkEntry for threshold, CTkSegmentedButton for >/< and Even/Odd. |
| Search | Opened a popup window. |
Inline: CTkEntry to input search value + "Find" button. |
| Linspace | Called linspace(array) (often incorrect usage). |
Inline Generator: Inputs for Start, Stop, and Count. |
| Random Int | Used array data as bounds. | Inline Generator: Inputs for Min, Max, and Count. |
| Rounding | Always rounded to integer. | Precision Control: Added input for Decimal Places. |
| Log/Power | Standard bases only ( |
Custom Base: Added input to calculate |
| Constants | Menu items inserted values. |
Dropdown: CTkOptionMenu to select constant + "Insert" button. |
| Num Systems | Separate menu items. |
Selector: CTkSegmentedButton (Bin/Oct/Hex) + Convert button. |
๐จ UI/UX Improvements
Layout & Styling
- Grid System: Migrated main layout from
pack()togrid()to support the split-pane design. - Input Frame: Grouped the two main input textboxes into a transparent
input_framefor better alignment. - Widget Upgrade: Replaced standard
tkinter.Textwithcustomtkinter.CTkTextbox.- Note: Explicitly enabled
undo=Trueon the underlying widget to maintain previous functionality.
- Note: Explicitly enabled
Grouping
- Trigonometry: Functions are now visually grouped: Standard, Conversion, Hyperbolic, Inverse Hyperbolic.
- Statistics: Grouped into Central Tendency, Extremes, and Dispersion.
๐ป Code Refactoring & Quality
Architecture
- Modular Construction: The
__init__method was monolithic. It has been refactored into specific helper methods for each tab:create_arithmetic_widgetscreate_data_widgetscreate_calculus_widgets- (and others...)
- Centralized Config: A
self.tabsdictionary now defines the structure of both the Tabs and the Menus, ensuring they stay in sync.
Logic & Stability
- Input Safety: Added
try-exceptblocks inturn_into_arrayand all inline operation methods.- Fix: Prevents the app from crashing if the user enters non-numeric text.
- Theme Logic: Refactored
themes()intoset_theme()andtoggle_theme().- Improvement: Relies more on
customtkinter's native theming rather than manually configuring widget colors line-by-line.
- Improvement: Relies more on
- Random Generator Fix: Updated
generate_op_numto correctly format list data as a space-separated string before inserting it into the text box (' '.join(map(str, ...))).
Imports
- Added
jsonandosto support the new StateManager.
๐ Bug Fixes
- Result Window Centering: Improved the math used to center the result popup window on the screen.
- Copy Error Handling: Added safety checks when copying results to the clipboard to prevent errors if the result format is unexpected.