Skip to content

Commit dc50130

Browse files
committed
Added use of new method Listbox.get_active_index rather than directly accessing tkinter widget. Included code to fallback to use widget if the new method isn't found in PySimpleGUI.
1 parent d490ba6 commit dc50130

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

psgfiglet/psgfiglet.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sys
99
import pyfiglet
1010

11-
version = '6.1.2'
11+
version = '6.1.3'
1212
__version__ = version.split()[0]
1313

1414
"""
@@ -24,7 +24,9 @@
2424
Made resizing of window work better
2525
Added option to prepend "#" onto front of each line with
2626
Navigating with arrow keys while in font list will select fonts so that previewing can be done quickly
27-
6.1.2 25-Jun-2026 Fixed setting an intial font
27+
6.1.2 25-Jun-2026 Fixed setting an initial font
28+
6.1.3 26-Jun-2026 Added use of new method Listbox.get_active_index rather than directly accessing tkinter widget. Included code
29+
to fallback to use widget if the new method isn't found in PySimpleGUI.
2830
"""
2931

3032

@@ -224,7 +226,11 @@ def main():
224226
window['-FONT-NAME-'].update(selected_font)
225227
values['-FONT-NAME-'] = selected_font
226228
elif event.endswith(('+DOWN', '+UP')): # if using arrow keys in the list of fonts
227-
index = window['-FONT-LIST-'].widget.index(sg.tk.ACTIVE)
229+
try:
230+
index = window['-FONT-LIST-'].get_active_index() # New method coming to PSG version 6.3
231+
except AttributeError:
232+
# print('Note - get_active_index not found. Using fallback implementation')
233+
index = window['-FONT-LIST-'].widget.index(sg.tk.ACTIVE)
228234
selected_font = fonts[index]
229235
window['-FONT-LIST-'].update(set_to_index=index)
230236
window['-FONT-NAME-'].update(selected_font)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def readme():
1111

1212
setuptools.setup(
1313
name="psgfiglet",
14-
version="6.1.2",
14+
version="6.1.3",
1515
author="PySimpleGUI",
1616
install_requires=["PySimpleGUI","pyfiglet"],
1717
description="Create Figlets using a PySimpleGUI GUI and pyfiglet. A PySimpleGUI Demo Program.",

0 commit comments

Comments
 (0)