Python Forum
[Tkinter] Problem of cursor
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Problem of cursor
#1
hello everybody excuse me for my writing's mistakes but i am francophone
i have a problem with a little script that i have written and i will join it with my message
it is a modified combobox which permit to make automatically research in a list of values linked to the combobox
but my problem now is that when i enter a value from my keyboard i am obliged to click again in the entry part of my combobox in order to continue to enter values
you can test the code that i have join in order to understand correctly my problem
thanks you for your answers
import tkinter as tk
import tkinter.ttk as ttk
 
def _validate(s):
    nv = [ x for x in values if x.startswith(s) ]
    cb['values'] = nv
    cb.event_generate('<Down>')
    return True
 
root = tk.Tk()
values = ['dad','mom','brother','sister','daddy','mommy']
validate = (root.register(_validate), '%P')    
cb = ttk.Combobox(root, values=values, validatecommand=validate,validate='key')
cb.pack()
tk.mainloop()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Take the variable of a cursor class delcencen 2 1,149 Feb-13-2023, 05:19 AM
Last Post: deanhystad
  [Tkinter] Finding out what's under the cursor sabresong 3 2,629 Mar-28-2020, 02:52 PM
Last Post: sabresong
  [Tkinter] Modifications on cursor Zyxcel314 3 2,971 Jun-04-2018, 04:36 PM
Last Post: Larz60+
  [Tkinter] Scroll at cursor position lollo 4 6,203 Jan-31-2018, 11:33 PM
Last Post: lollo

Forum Jump:

User Panel Messages

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