You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
V is literally futuristic modern langauge... but here in UI library we need some of the cool features to push the library to next level
We need key bindings..
For example in python using Tkinter:
importtkinterastkclassMyWidget(tk.Frame):
def__init__(self, parent):
super().__init__(parent)
self.textbox=tk.Entry(self)
self.button=tk.Button(self, text="Enter", command=self.on_button_click)
self.textbox.pack(side="left")
self.button.pack(side="left")
# Bind the button to the "enter" keyself.textbox.bind("<Return>", self.on_enter_press)
defon_button_click(self):
# This function will be called when the button is clickedprint("Button clicked")
defon_enter_press(self, event):
# This function will be called when the "enter" key is pressedself.button.invoke()
root=tk.Tk()
# Set the default size of the windowroot.geometry("500x500")
widget=MyWidget(root)
widget.pack()
root.mainloop()
Here, in this simple application we have bided the button with enter key. When I click enter key it atomatically clicks the button.
But I've not seen or Iam not aware of such things in this UI library? any suggestions? or anything?
The text was updated successfully, but these errors were encountered:
V is literally futuristic modern langauge... but here in UI library we need some of the cool features to push the library to next level
We need key bindings..
For example in python using Tkinter:
Here, in this simple application we have bided the button with
enter key
. When I clickenter key
it atomatically clicks the button.But I've not seen or Iam not aware of such things in this UI library? any suggestions? or anything?
The text was updated successfully, but these errors were encountered: