I have used gtk.Notebook() in my script, In notebook tab I have given 2 text fields username and password but problem is that the entry field does not behave as password field, it is showing character. so I want if i type password it should be confidential jsut like as (*).
This is code which i have used
entry = gtk.Entry()
entry.set_invisible_char("*")
entry.set_size_request(100, 75)
entry.show ()
label = gtk.Label("Add page")
notebook.insert_page(entry, label, 2)
Now anyone tell me how to do that.
Thanks in advance...
Gtk Entry documentation:
gtk_entry_set_visibility() sets whether the contents of the entry are visible or not. When visibility is set to FALSE, characters are displayed as the invisible char, and will also appear that way when the text in the entry widget is copied elsewhere.
For python that should be Entry.set_visibility(False).
Also, you don't need to set the invisible character: GTK+ will do it's best to pick a good character for the font in question (typically '*').
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With