Python Forum
[Tkinter] selecting buttons with keyboard
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] selecting buttons with keyboard
#1
Hello,

my problem:

i have some simple GUI, with some text entrys, and radiobuttons
i can select on them by mouse, but i want to do it with enter key
how i can do that?
Reply
#2
GUI can be created with several frameworks, which one do you use?
And how do you "point" to the radio button, so you can select it with Enter then?
Reply
#3
You need to bind your widget with the Return string as well as the function to run when you hit enter
my_textbox.bind("<Return>", self.func_to_run)
Output:
my_textbox.bind("<Return>", self.func_to_run)
Recommended Tutorials:
Reply
#4
(Oct-05-2016, 12:32 PM)j.crater Wrote: GUI can be created with several frameworks, which one do you use?
And how do you "point" to the radio button, so you can select it with Enter then?
its Tkinter
if i want it fast im just going with "Tab"

(Oct-05-2016, 12:43 PM)metulburr Wrote: You need to bind your widget with the Return string as well as the function to run when you hit enter
my_textbox.bind("<Return>", self.func_to_run)
this looks like this
there is 2 radiobuttons
and START button with take value from 1 or 2 radio button
i want to go through the menu and select things with '<return>' and later want to START app with same '<return>' also
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020