Am 25.01.17 um 10:18 schrieb Peter Otten:
hmmeeranrizv...@gmail.com wrote:

Hello Guys,
Here i am creating a entry box with some text,i need to hide the text when
i click on it.

search.bind("<Button-1>", clear_search)


This is the correct answer for a mouse click. The typical use case (disappearing placeholder) should also trigger, when somebody uses the tab key to set the focus to the window. This can be achieved by binding to the <FocusIn> event instead:

        search.bind("<FocusIn>", clear_search)

In addition, repeated clicking does not clear the text then.

        Christian
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to