Nov-05-2023, 08:08 AM
Hi,
I have 4 (T)Entry widgets, they are enabled or disabled in various combinations, depending on
user actions. Works fine.
I would like to add one feature, that I know exists, but is it available in tKinter?
Imagine 2 Entries state= NORMAL.
User could type anything in one or both. OK.
It would help if he knew that it is better if he typed a name in the first, and a city in the second.
(Yes I can put labels, yes he should read the manual... I would like something more sophisticated).
Sometimes you see in apps that a textbox already contains a suggested input in faint (opaque) letters,
that disappear as soon as you start typing in the box.
If he types nothing in that box, the opaque text is also not regarded as a search key.
I have looked into "transparent fonts, default text in entry boxes ... they do qualify as far as i can see.
I hope I've made myself clear.
Can I achieve this in tKinter?
thx,
Paul
Edit: it appears that something similar can be achieved by inserting a default text and bind the Entry to <FocusIn>,
deleting the default text. On pushing the search button, I will need AI to see if it's the default text, or something else was entered. :-)
Unless some standard feature comes with ttk Enries, this will do.
I have 4 (T)Entry widgets, they are enabled or disabled in various combinations, depending on
user actions. Works fine.
I would like to add one feature, that I know exists, but is it available in tKinter?
Imagine 2 Entries state= NORMAL.
User could type anything in one or both. OK.
It would help if he knew that it is better if he typed a name in the first, and a city in the second.
(Yes I can put labels, yes he should read the manual... I would like something more sophisticated).
Sometimes you see in apps that a textbox already contains a suggested input in faint (opaque) letters,
that disappear as soon as you start typing in the box.
If he types nothing in that box, the opaque text is also not regarded as a search key.
I have looked into "transparent fonts, default text in entry boxes ... they do qualify as far as i can see.
I hope I've made myself clear.
Can I achieve this in tKinter?
thx,
Paul
Edit: it appears that something similar can be achieved by inserting a default text and bind the Entry to <FocusIn>,
deleting the default text. On pushing the search button, I will need AI to see if it's the default text, or something else was entered. :-)
Unless some standard feature comes with ttk Enries, this will do.