hildon.NamePasswordDialog

hildon.NamePasswordDialog

A widget which allows a user to enter username and password.

Description

Used to enter a username and password when accessing a password protected function.

Ancestry

Up to the first non-hildon ancestor:

...
 +-- gtk.Dialog
      +-- hildon.NamePasswordDialog

Usage Example

import gtk
import hildon

def on_click(widget, window):
    dialog = hildon.NamePasswordDialog(window)
    
    response = dialog.run()
    dialog.hide()
    
    if response == gtk.RESPONSE_OK:
        widget.set_label("Name: %s\nPassword: %s" % (dialog.get_name(), dialog.get_password()))
    else:
        widget.set_label("Enter name and password")
        
    dialog.destroy()

window = hildon.Window()
window.set_title("Test App")

button = gtk.Button("Enter name and password")
button.connect("clicked", on_click, window)

window.add(button)

window.show_all()

gtk.main()
      

Properties

Name Access Description
"content" Read/Write Set content for content label.
"name" Read/Write Set content for name entry.
"password" Read/Write Set content for password entry.

Constructor

Creates a new hildon.NamePasswordDialog.

hildon.NamePasswordDialog(parent)
parent Its parent window.
Returns A new hildon.NamePasswordDialog.

Methods

get_name

Gets the text that's in the name entry.

hildon.NamePasswordDialog.get_name()
Returns The text that's in the name entry.

get_password

Gets the text that's in the password entry.

hildon.NamePasswordDialog.get_password()
Returns The text that's in the password entry.

set_domain

Sets the optional descriptive text.

hildon.NamePasswordDialog.set_domain(domain)
domain The domain or some other descriptive text to be set.


Improve this page