Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard shortcut not changing menu radio buttons #649

Open
OIK2 opened this issue Aug 3, 2022 · 1 comment
Open

Keyboard shortcut not changing menu radio buttons #649

OIK2 opened this issue Aug 3, 2022 · 1 comment

Comments

@OIK2
Copy link

OIK2 commented Aug 3, 2022

Bug Report


Context


I am creating a submenu of menu radio buttons with a for loop, including shortcuts. The menu works, but the shortcuts do not.

Expected Behaviour


For the submenu to show a list of menu radio buttons numbered 0-9, each with the shortcut Ctrl-#(0-9). They all activate the same function to change the number of places to display after a decimal point.

Actual Behaviour


They show up correctly, display the shortcut correctly, and work when clicked, but nothing seems to happen when the shortcut is used.

Any error messages produced by appJar


No errors produced.

Sample code, demonstrating the issue


def fpChange(name):
	global this
	this['fp'] = app.getMenuRadioButton("Max Digits After Decimal",name)
	conv()
	pass
app.addSubMenu("View","Max Digits After Decimal")
for i in range(10):
	app.addMenuRadioButton("Max Digits After Decimal","fp",i,fpChange,shortcut=f"Control-{i}")

What steps are needed to reproduce the bug


Attempt to use the keyboard shortcut to try to change the selected menu radio button.

Version Information


appJar: 0.94.0 Python: 3.10.4 TCL: 8.6, TK: 8.6 Platform: Linux pid: 11798 locale: en_US

@OIK2
Copy link
Author

OIK2 commented Aug 3, 2022

I did more testing...
I checked if it was a problem of using numbers with shortcut keys, still did it with letters(and other shortcuts work in the program).

Checked if it was using the f-string, not the problem.

Checked if it was the loop, not it, still did it when I turned the 2 lines into 10 with hard coded values.

The only thing that I see is the menu radio buttons and shortcuts. I have shortcuts on menu items and menu check boxes, but these are the only menu radio buttons that I have use shortcuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant