Python Hildon Widgets - Part 2
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
The article is believed to be still valid for the original topic scope.
The article is believed to be still valid for the original topic scope.
Article Metadata
hildon.Note
Notes are used to ask a confirmation (Ok/Cancel/etc.) from the user. The following code shows a confirmation note and changes the button label based on user's response.
def button_callback(widget, button, window):
dialog = hildon.Note ("confirmation", (window, "Are you sure?", gtk.STOCK_DIALOG_WARNING) )
dialog.set_button_texts ("Yes", "No")
response = dialog.run()
dialog.destroy()
if response == gtk.RESPONSE_OK:
button.set_label("Confirmed")
else:
button.set_label("Canceled")
hildon.SetPasswordDialog
Dialog used to receive a new password from user.
def button_callback(widget, button, window): passwordDialog = hildon.SetPasswordDialog(window, False) response = passwordDialog.run() passwordDialog.hide() passwordDialog.destroy()
hildon.TimePicker
It is a dialog popup widget which lets the user set a time.
def button_callback(widget, button, window): time_picker = hildon.TimePicker(window) response = time_picker.run() time_picker.hide()





(no comments yet)