Hi,
I am using tkinter and may be doing something not allowed.
Here is the pseudocode:
I have a listbox with items in it.
When i click on an item it gets selected and also gets focus.
i put the descriprion of the selected item in a variable and do something with it.
So far so good.
At the end of the click_event, i want to move the focus onto an entry field with a entryfield.focus().
It refuses to do that, i have to do it manually with tab.
Question:
Is there a rule that says that if you manually click ("select") on a listbox (thus receiving focus),
you cannot expect the code in this click event to move focus to something else?
thx,
Paul
EDIT: after testing, i have a result. Setting the listbox state to 'disabled' does the trick. Focus shifts to only other focusable field.
I am using tkinter and may be doing something not allowed.
Here is the pseudocode:
I have a listbox with items in it.
When i click on an item it gets selected and also gets focus.
i put the descriprion of the selected item in a variable and do something with it.
So far so good.
At the end of the click_event, i want to move the focus onto an entry field with a entryfield.focus().
It refuses to do that, i have to do it manually with tab.
Question:
Is there a rule that says that if you manually click ("select") on a listbox (thus receiving focus),
you cannot expect the code in this click event to move focus to something else?
1 2 3 4 5 6 |
def on_select(evt): global currentImage w = evt.widget index = w.curselection()[ 0 ] currentImage = w.get(index) entryScore.focus() |
Paul
EDIT: after testing, i have a result. Setting the listbox state to 'disabled' does the trick. Focus shifts to only other focusable field.